git.iko.soy/typeable/swagger2
on master help sign in
Remove useReferences from SchemaOptions
commit900515b8c3a80cd5f0e47f334d3fd457c681f10b authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateSat 12 Dec 2015, 15:42 (11 years ago) parentd776474
1 file changed−18
src/Data/Swagger/SchemaOptions.hs−18
src/Data/Swagger/SchemaOptions.hs−18
@@ -11,22 +11,6 @@ data SchemaOptions = SchemaOptions
1111 -- | If @'True'@ the constructors of a datatype, with all nullary constructors,
1212 -- will be encoded to a string enumeration schema with the constructor tags as possible values.
1313 , allNullaryToStringTag :: Bool
14− -- | If @'True'@ direct subschemas will be referenced if possible (rather than inlined).
15− -- Note that this option does not influence nested schemas, e.g. for these types
16− --
17− -- @
18− -- data Object = Object String deriving Generic
19− -- instance ToSchema Object
20− --
21− -- newtype Objects = Objects [Object] deriving Generic
22− -- instance ToSchema Objects where
23− -- toNamedSchema = genericToNamedSchema defaultSchemaOptions
24− -- { useReferences = False }
25− -- @
26− --
27− -- Schema for @Objects@ __will not__ inline @Object@ schema because
28− -- it is nested in a @[]@ schema.
29− , useReferences :: Bool
3014 -- | Hide the field name when a record constructor has only one field, like a newtype.
3115 , unwrapUnaryRecords :: Bool
3216 }
@@ -39,7 +23,6 @@ data SchemaOptions = SchemaOptions
3923-- , 'constructorTagModifier' = id
4024-- , 'datatypeNameModifier' = id
4125-- , 'allNullaryToStringTag' = True
42−-- , 'useReferences' = True
4326-- , 'unwrapUnaryRecords' = False
4427-- }
4528-- @
@@ -49,7 +32,6 @@ defaultSchemaOptions = SchemaOptions
4932 , constructorTagModifier = id
5033 , datatypeNameModifier = id
5134 , allNullaryToStringTag = True
52− , useReferences = True
5335 , unwrapUnaryRecords = False
5436 }
5537