Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class AesonDefaultValue a where
- defaultValue :: Maybe a
- 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
- swaggerAesonOptions :: Proxy a -> SwaggerAesonOptions
- aesonDefaults :: Proxy a -> POP Maybe (Code a)
- data SwaggerAesonOptions
- mkSwaggerAesonOptions :: String -> SwaggerAesonOptions
- saoPrefix :: Lens' SwaggerAesonOptions String
- saoAdditionalPairs :: Lens' SwaggerAesonOptions [Pair]
- saoSubObject :: Lens' SwaggerAesonOptions (Maybe String)
Generic functions
class AesonDefaultValue a where Source #
Nothing
defaultValue :: Maybe a Source #
Instances
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 #
Instances
data SwaggerAesonOptions Source #
mkSwaggerAesonOptions Source #
:: String | prefix |
-> SwaggerAesonOptions |