1module Data.Swagger.SchemaOptions where
3-- | Options that specify how to encode your type to Swagger schema.
4data SchemaOptions = SchemaOptions
5 { -- | Function applied to field labels. Handy for removing common record prefixes for example.
6 fieldLabelModifier :: String -> String
7 -- | Function applied to constructor tags which could be handy for lower-casing them for example.
8 , constructorTagModifier :: String -> String
9 -- | Function applied to datatype name.
10 , datatypeNameModifier :: String -> String
11 -- | If @'True'@ the constructors of a datatype, with all nullary constructors,
12 -- will be encoded to a string enumeration schema with the constructor tags as possible values.
13 , allNullaryToStringTag :: Bool
14 -- | Hide the field name when a record constructor has only one field, like a newtype.
15 , unwrapUnaryRecords :: Bool
18-- | Default encoding @'SchemaOptions'@.
22-- { 'fieldLabelModifier' = id
23-- , 'constructorTagModifier' = id
24-- , 'datatypeNameModifier' = id
25-- , 'allNullaryToStringTag' = True
26-- , 'unwrapUnaryRecords' = False
29defaultSchemaOptions :: SchemaOptions
30defaultSchemaOptions = SchemaOptions
31 { fieldLabelModifier = id
32 , constructorTagModifier = id
33 , datatypeNameModifier = id
34 , allNullaryToStringTag = True
35 , unwrapUnaryRecords = False
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list