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.

  1. _linkOperationId :: Link -> Maybe Text

    openapi3 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.

  2. _operationOperationId :: Operation -> Maybe Text

    openapi3 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.

  3. module Data.OpenApi.Internal.Schema.Validation

    Validate JSON values with Swagger Schema.

  4. newtype Validation s a

    openapi3 Data.OpenApi.Internal.Schema.Validation

    Value validation.

  5. Validation :: (Config -> s -> Result a) -> Validation s a

    openapi3 Data.OpenApi.Internal.Schema.Validation

    No documentation available.

  6. type ValidationError = String

    openapi3 Data.OpenApi.Internal.Schema.Validation

    Validation error message.

  7. invalid :: String -> Validation schema a

    openapi3 Data.OpenApi.Internal.Schema.Validation

    Issue an error message.

  8. renderValidationErrors :: (ToJSON a, ToSchema a) => (a -> [ValidationError]) -> a -> Maybe String

    openapi3 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"
    }
    }
    

  9. runValidation :: Validation s a -> Config -> s -> Result a

    openapi3 Data.OpenApi.Internal.Schema.Validation

    No documentation available.

  10. valid :: Validation schema ()

    openapi3 Data.OpenApi.Internal.Schema.Validation

    Validation passed.

Page 623 of many | Previous | Next