Hoogle Search
Within LTS Haskell 24.64 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
_linkOperationId :: Link -> Maybe Textopenapi3 Data.OpenApi.Internal The name of an existing, resolvable OAS operation, as defined with a unique _operationOperationId. This field is mutually exclusive of the _linkOperationRef field.
_operationOperationId :: Operation -> Maybe Textopenapi3 Data.OpenApi.Internal Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
module Data.OpenApi.Internal.Schema.
Validation Validate JSON values with Swagger Schema.
-
openapi3 Data.OpenApi.Internal.Schema.Validation Value validation.
Validation :: (Config -> s -> Result a) -> Validation s aopenapi3 Data.OpenApi.Internal.Schema.Validation No documentation available.
-
openapi3 Data.OpenApi.Internal.Schema.Validation Validation error message.
invalid :: String -> Validation schema aopenapi3 Data.OpenApi.Internal.Schema.Validation Issue an error message.
renderValidationErrors :: (ToJSON a, ToSchema a) => (a -> [ValidationError]) -> a -> Maybe Stringopenapi3 Data.OpenApi.Internal.Schema.Validation Pretty print validation errors together with actual JSON and Swagger Schema (using encodePretty).
>>> import Data.Aeson as Aeson >>> import Data.Foldable (traverse_) >>> import GHC.Generics >>> data Phone = Phone { value :: String } deriving (Generic) >>> data Person = Person { name :: String, phone :: Phone } deriving (Generic) >>> instance ToJSON Person where toJSON p = object [ "name" Aeson..= name p ] >>> instance ToSchema Phone >>> instance ToSchema Person >>> let person = Person { name = "John", phone = Phone "123456" } >>> traverse_ putStrLn $ renderValidationErrors validateToJSON person Validation against the schema fails: * property "phone" is required, but not found in "{\"name\":\"John\"}" JSON value: { "name": "John" } Swagger Schema: { "properties": { "name": { "type": "string" }, "phone": { "$ref": "#/components/schemas/Phone" } }, "required": [ "name", "phone" ], "type": "object" } Swagger Description Context: { "Phone": { "properties": { "value": { "type": "string" } }, "required": [ "value" ], "type": "object" } }runValidation :: Validation s a -> Config -> s -> Result aopenapi3 Data.OpenApi.Internal.Schema.Validation No documentation available.
-
openapi3 Data.OpenApi.Internal.Schema.Validation Validation passed.