Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
genericParseJSONValidated :: forall a. (Generic a, GFromJSON Zero (Rep a), Selectors (Rep a)) => Options -> Value -> Parser a Source #
validateObjectKeys :: [String] -> HashMap Text v -> Parser () Source #
Validate there are no unexpected keys in an Object
This is provided for convenience in the most common use-case. For a more
flexible interface, see
.validateExpectedKeyBy
validateExpectedKeyBy Source #
:: String | The label to show as Unknown <label> ... |
-> (a -> String) | A function to project each valid value as a comparable key |
-> [a] | The input list of valid items |
-> String | The input key |
-> Either String a |
Validate that a key is present in a list of (projected) items
Returns the item found when validation passes.