swagger2-2.1.4.1: Swagger 2.0 data model

Maintainer | Nickolay Kudasov <nickolay@getshoptv.com>
Stability | experimental
Safe Haskell | Safe
Language | Haskell2010

Data.Swagger.SchemaOptions

Description

Generic deriving options for ``ToParamSchema`` and ``ToSchema``.

Synopsis

- data SchemaOptions = SchemaOptions {
  - fieldLabelModifier :: String -> String
  - constructorTagModifier :: String -> String
  - datatypeNameModifier :: String -> String
  - allNullaryToStringTag :: Bool
  - unwrapUnaryRecords :: Bool
  }
- defaultSchemaOptions :: SchemaOptions

# Documentation

data SchemaOptions #

Options that specify how to encode your type to Swagger schema.

Constructors

SchemaOptions |
Fields fieldLabelModifier :: String -> String Function applied to field labels. Handy for removing common record prefixes for example. constructorTagModifier :: String -> String Function applied to constructor tags which could be handy for lower-casing them for example. datatypeNameModifier :: String -> String Function applied to datatype name. allNullaryToStringTag :: Bool If ``True`` the constructors of a datatype, with all nullary constructors, will be encoded to a string enumeration schema with the constructor tags as possible values. unwrapUnaryRecords :: Bool Hide the field name when a record constructor has only one field, like a newtype.

defaultSchemaOptions :: SchemaOptions #

Default encoding ``SchemaOptions``.

    SchemaOptions
    { fieldLabelModifier     = id
    , constructorTagModifier = id
    , datatypeNameModifier   = id
    , allNullaryToStringTag  = True
    , unwrapUnaryRecords     = False
    }