Hoogle Search

Within LTS Haskell 24.25 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. 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"
    }
    }
    

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

    openapi3 Data.OpenApi.Internal.Schema.Validation

    No documentation available.

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

    openapi3 Data.OpenApi.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"
    }
    }
    

  4. package crypton-x509-validation

    X.509 Certificate and CRL validation X.509 Certificate and CRL validation. please see README

  5. defaultValidationCache :: ValidationCache

    crypton-x509-validation Data.X509.Validation

    No documentation available.

  6. exceptionValidationCache :: [(ServiceID, Fingerprint)] -> ValidationCache

    crypton-x509-validation Data.X509.Validation

    create a simple constant cache that list exceptions to the certification validation. Typically this is use to allow self-signed certificates for specific use, with out-of-bounds user checks. No fingerprints will be added after the instance is created. The underlying structure for the check is kept as a list, as usually the exception list will be short, but when the list go above a dozen exceptions it's recommended to use another cache mechanism with a faster lookup mechanism (hashtable, map, etc). Note that only one fingerprint is allowed per ServiceID, for other use, another cache mechanism need to be use.

  7. tofuValidationCache :: [(ServiceID, Fingerprint)] -> IO ValidationCache

    crypton-x509-validation Data.X509.Validation

    Trust on first use (TOFU) cache with an optional list of exceptions this is similar to the exceptionCache, except that after each succesfull validation it does add the fingerprint to the database. This prevent any further modification of the fingerprint for the remaining

  8. class HasValidationPolicy s

    jose Crypto.JOSE.JWS

    No documentation available.

  9. class HasValidationSettings a

    jose Crypto.JOSE.JWS

    No documentation available.

  10. defaultValidationSettings :: ValidationSettings

    jose Crypto.JOSE.JWS

    The default validation settings.

    • All algorithms except "none" are acceptable.
    • All signatures must be valid (and there must be at least one signature.)

Page 17 of many | Previous | Next