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.
renderValidationErrors :: (ToJSON a, ToSchema a) => (a -> [ValidationError]) -> a -> Maybe Stringswagger2 Data.Swagger.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": "#/definitions/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 aswagger2 Data.Swagger.Internal.Schema.Validation No documentation available.
renderValidationErrors :: (ToJSON a, ToSchema a) => (a -> [ValidationError]) -> a -> Maybe Stringswagger2 Data.Swagger.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": "#/definitions/Phone" } }, "required": [ "name", "phone" ], "type": "object" } Swagger Description Context: { "Phone": { "properties": { "value": { "type": "string" } }, "required": [ "value" ], "type": "object" } }data
RoleValidationFailedReason ghc-lib-parser GHC.Tc.Errors.Types No documentation available.
TcRnRoleValidationFailed :: Role -> RoleValidationFailedReason -> TcRnMessageghc-lib-parser GHC.Tc.Errors.Types TcRnRoleValidationFailed is an error indicating that a variable was assigned an invalid role by the inference algorithm. This is only performed with -dcore-lint.
DeserializationErrorValidation :: String -> DeserializationErrorhackage-security Hackage.Security.JSON Some verification step failed
DeserializationErrorValidation :: String -> DeserializationErrorhackage-security Hackage.Security.Server Some verification step failed
-
webgear-core WebGear.Core.Trait.Auth.JWT Settings to validate the JWT
FULL_VALIDATION :: VALIDATION_MODEmorpheus-graphql-app Data.Morpheus.App No documentation available.
NeovimValidation :: ByteString -> NeovimExceptionGennvim-hs Neovim.API.ByteString No documentation available.