swagger2-2.2: Swagger 2.0 data model

Safe HaskellNone
LanguageHaskell2010

Data.Swagger.Internal.AesonUtils

Contents

Synopsis

Generic functions

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

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

Options

class (Generic a, All2 AesonDefaultValue (Code a)) => HasSwaggerAesonOptions a where Source #

Minimal complete definition

swaggerAesonOptions

Instances

HasSwaggerAesonOptions SecurityScheme Source # 
HasSwaggerAesonOptions OAuth2Params Source # 
HasSwaggerAesonOptions Header Source # 
HasSwaggerAesonOptions Response Source # 
HasSwaggerAesonOptions Responses Source # 
HasSwaggerAesonOptions Schema Source # 
HasSwaggerAesonOptions ParamOtherSchema Source # 
HasSwaggerAesonOptions Param Source # 
HasSwaggerAesonOptions Operation Source # 
HasSwaggerAesonOptions PathItem Source # 
HasSwaggerAesonOptions Swagger Source # 
HasSwaggerAesonOptions (ParamSchema (SwaggerKindNormal * t)) Source # 
HasSwaggerAesonOptions (ParamSchema (SwaggerKindParamOtherSchema *)) Source # 
HasSwaggerAesonOptions (ParamSchema (SwaggerKindSchema *)) Source #