Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class AesonDefaultValue a where
- sopSwaggerGenericToJSON :: forall a xs. (HasDatatypeInfo a, HasSwaggerAesonOptions a, All2 ToJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => a -> Value
- sopSwaggerGenericToEncoding :: forall a xs. (HasDatatypeInfo a, HasSwaggerAesonOptions a, All2 ToJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => a -> Encoding
- sopSwaggerGenericToJSONWithOpts :: forall a xs. (Generic a, All2 AesonDefaultValue (Code a), HasDatatypeInfo a, All2 ToJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => SwaggerAesonOptions -> a -> Value
- sopSwaggerGenericParseJSON :: forall a xs. (HasDatatypeInfo a, HasSwaggerAesonOptions a, All2 FromJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => Value -> Parser a
- class (Generic a, All2 AesonDefaultValue (Code a)) => HasSwaggerAesonOptions a where
- data SwaggerAesonOptions
- mkSwaggerAesonOptions :: String -> SwaggerAesonOptions
- saoPrefix :: Lens' SwaggerAesonOptions String
- saoAdditionalPairs :: Lens' SwaggerAesonOptions [(Text, Value)]
- saoSubObject :: Lens' SwaggerAesonOptions (Maybe String)
Generic functions
class AesonDefaultValue a where Source #
defaultValue :: Maybe a Source #
sopSwaggerGenericToJSON :: forall a xs. (HasDatatypeInfo a, HasSwaggerAesonOptions a, All2 ToJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => a -> Value Source #
Generic serialisation for swagger records.
Features
- omits nulls, empty objects and empty arrays (configurable)
- possible to add fields
- possible to merge sub-object
sopSwaggerGenericToEncoding :: forall a xs. (HasDatatypeInfo a, HasSwaggerAesonOptions a, All2 ToJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => a -> Encoding Source #
sopSwaggerGenericToJSONWithOpts :: forall a xs. (Generic a, All2 AesonDefaultValue (Code a), HasDatatypeInfo a, All2 ToJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => SwaggerAesonOptions -> a -> Value Source #
- TODO:* This is only used by ToJSON (ParamSchema SwaggerKindSchema)
Also uses default aesonDefaults
sopSwaggerGenericParseJSON :: forall a xs. (HasDatatypeInfo a, HasSwaggerAesonOptions a, All2 FromJSON (Code a), All2 Eq (Code a), Code a ~ '[xs]) => Value -> Parser a Source #
Options
class (Generic a, All2 AesonDefaultValue (Code a)) => HasSwaggerAesonOptions a where Source #
swaggerAesonOptions :: proxy a -> SwaggerAesonOptions Source #
data SwaggerAesonOptions Source #
mkSwaggerAesonOptions Source #
:: String | prefix |
-> SwaggerAesonOptions |