@@ -338,6 +338,29 @@ data MediaTypeObject = MediaTypeObject
338338 , _mediaTypeObjectEncoding :: InsOrdHashMap Text Encoding
339339 } deriving (Eq, Show, Generic, Data, Typeable)
340340
341+-- | In order to support common ways of serializing simple parameters, a set of style values are defined.
342+data Style
343+ = StyleMatrix
344+ -- ^ Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7).
345+ | StyleLabel
346+ -- ^ Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7).
347+ | StyleForm
348+ -- ^ Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7).
349+ -- This option replaces @collectionFormat@ with a @csv@ (when @explode@ is false) or @multi@
350+ -- (when explode is true) value from OpenAPI 2.0.
351+ | StyleSimple
352+ -- ^ Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7).
353+ -- This option replaces @collectionFormat@ with a @csv@ value from OpenAPI 2.0.
354+ | StyleSpaceDelimited
355+ -- ^ Space separated array values.
356+ -- This option replaces @collectionFormat@ equal to @ssv@ from OpenAPI 2.0.
357+ | StylePipeDelimited
358+ -- ^ Pipe separated array values.
359+ -- This option replaces @collectionFormat@ equal to @pipes@ from OpenAPI 2.0.
360+ | StyleDeepObject
361+ -- ^ Provides a simple way of rendering nested objects using form parameters.
362+ deriving (Eq, Show, Generic, Data, Typeable)
363+
341364data Encoding = Encoding
342365 { -- | The Content-Type for encoding a specific property.
343366 -- Default value depends on the property type: for @string@
@@ -355,11 +378,11 @@ data Encoding = Encoding
355378 , _encodingHeaders :: InsOrdHashMap Text (Referenced Header)
356379
357380 -- | Describes how a specific property value will be serialized depending on its type.
358− -- See Parameter Object for details on the style property.
381+ -- See 'Param' Object for details on the style property.
359382 -- The behavior follows the same values as query parameters, including default values.
360383 -- This property SHALL be ignored if the request body media type
361384 -- is not @application/x-www-form-urlencoded@.
362− , _encodingStyle :: Maybe Text -- TODO enum
385+ , _encodingStyle :: Maybe Style
363386
364387 -- | When this is true, property values of type @array@ or @object@ generate
365388 -- separate parameters for each value of the array,
@@ -424,10 +447,38 @@ data Param = Param
424447 -- | Sets the ability to pass empty-valued parameters.
425448 -- This is valid only for 'ParamQuery' parameters and allows sending
426449 -- a parameter with an empty value. Default value is @false@.
427− , _paramOtherSchemaAllowEmptyValue :: Maybe Bool
450+ , _paramAllowEmptyValue :: Maybe Bool
428451
429452 -- | Parameter schema.
430453 , _paramSchema :: Maybe (Referenced Schema)
454+
455+ -- | Describes how the parameter value will be serialized depending
456+ -- on the type of the parameter value. Default values (based on value of '_paramIn'):
457+ -- for 'ParamQuery' - 'StyleForm'; for 'ParamPath' - 'StyleSimple'; for 'ParamHeader' - 'StyleSimple';
458+ -- for 'ParamCookie' - 'StyleForm'.
459+ , _paramStyle :: Maybe Style
460+
461+ -- | When this is true, parameter values of type @array@ or @object@
462+ -- generate separate parameters for each value of the array or key-value pair of the map.
463+ -- For other types of parameters this property has no effect.
464+ -- When style is @form@, the default value is true. For all other styles, the default value is false.
465+ , _paramExplode :: Maybe Bool
466+
467+ -- | Example of the parameter's potential value.
468+ -- The example SHOULD match the specified schema and encoding properties if present.
469+ -- The '_paramExample' field is mutually exclusive of the '_paramExamples' field.
470+ -- Furthermore, if referencing a schema that contains an example, the example value
471+ -- SHALL override the example provided by the schema. To represent examples of media types
472+ -- that cannot naturally be represented in JSON or YAML, a string value can contain
473+ -- the example with escaping where necessary.
474+ , _paramExample :: Maybe Value
475+
476+ -- | Examples of the parameter's potential value.
477+ -- Each example SHOULD contain a value in the correct format as specified
478+ -- in the parameter encoding. The '_paramExamples' field is mutually exclusive of the '_paramExample' field.
479+ -- Furthermore, if referencing a schema that contains an example,
480+ -- the examples value SHALL override the example provided by the schema.
481+ , _paramExamples :: InsOrdHashMap Text (Referenced Example)
431482 } deriving (Eq, Show, Generic, Data, Typeable)
432483
433484data Example = Example
@@ -454,136 +505,26 @@ data Example = Example
454505
455506-- | Items for @'SwaggerArray'@ schemas.
456507--
457−-- @'SwaggerItemsPrimitive'@ should be used only for query params, headers and path pieces.
458−-- The @'CollectionFormat' t@ parameter specifies how elements of an array should be displayed.
459−-- Note that @fmt@ in @'SwaggerItemsPrimitive' fmt schema@ specifies format for elements of type @schema@.
460−-- This is different from the original Swagger's <http://swagger.io/specification/#itemsObject Items Object>.
508+-- __Warning__: OpenAPI 3.0 does not support tuple arrays. However, OpenAPI 3.1 will, as
509+-- it will incorporate Json Schema mostly verbatim.
461510--
462511-- @'SwaggerItemsObject'@ should be used to specify homogenous array @'Schema'@s.
463512--
464513-- @'SwaggerItemsArray'@ should be used to specify tuple @'Schema'@s.
465−data SwaggerItems t where
466− SwaggerItemsPrimitive :: Maybe (CollectionFormat k) -> ParamSchema k-> SwaggerItems k
467− SwaggerItemsObject :: Referenced Schema -> SwaggerItems 'SwaggerKindSchema
468− SwaggerItemsArray :: [Referenced Schema] -> SwaggerItems 'SwaggerKindSchema
469− deriving (Typeable)
470−
471−deriving instance Eq (SwaggerItems t)
472−deriving instance Show (SwaggerItems t)
473−--deriving instance Typeable (SwaggerItems t)
474−
475−swaggerItemsPrimitiveConstr :: Constr
476−swaggerItemsPrimitiveConstr = mkConstr swaggerItemsDataType "SwaggerItemsPrimitive" [] Prefix
477−
478−swaggerItemsObjectConstr :: Constr
479−swaggerItemsObjectConstr = mkConstr swaggerItemsDataType "SwaggerItemsObject" [] Prefix
480−
481−swaggerItemsArrayConstr :: Constr
482−swaggerItemsArrayConstr = mkConstr swaggerItemsDataType "SwaggerItemsArray" [] Prefix
483−
484−swaggerItemsDataType :: DataType
485−swaggerItemsDataType = mkDataType "Data.Swagger.SwaggerItems" [swaggerItemsPrimitiveConstr]
486−
487−-- Note: unfortunately we have to write these Data instances by hand,
488−-- to get better contexts / avoid duplicate name when using standalone deriving
489−
490−instance Data t => Data (SwaggerItems ('SwaggerKindNormal t)) where
491− -- TODO: define gfoldl
492− gunfold k z c = case constrIndex c of
493− 1 -> k (k (z SwaggerItemsPrimitive))
494− _ -> error $ "Data.Data.gunfold: Constructor " ++ show c ++ " is not of type (SwaggerItems t)."
495− toConstr _ = swaggerItemsPrimitiveConstr
496− dataTypeOf _ = swaggerItemsDataType
497−
498−-- SwaggerItems SwaggerKindParamOtherSchema can be constructed using SwaggerItemsPrimitive only
499−instance Data (SwaggerItems 'SwaggerKindParamOtherSchema) where
500− -- TODO: define gfoldl
501− gunfold k z c = case constrIndex c of
502− 1 -> k (k (z SwaggerItemsPrimitive))
503− _ -> error $ "Data.Data.gunfold: Constructor " ++ show c ++ " is not of type (SwaggerItems SwaggerKindParamOtherSchema)."
504− toConstr _ = swaggerItemsPrimitiveConstr
505− dataTypeOf _ = swaggerItemsDataType
506−
507−instance Data (SwaggerItems 'SwaggerKindSchema) where
508− gfoldl _ _ (SwaggerItemsPrimitive _ _) = error " Data.Data.gfoldl: Constructor SwaggerItemsPrimitive used to construct SwaggerItems SwaggerKindSchema"
509− gfoldl k z (SwaggerItemsObject ref) = z SwaggerItemsObject `k` ref
510− gfoldl k z (SwaggerItemsArray ref) = z SwaggerItemsArray `k` ref
511−
512− gunfold k z c = case constrIndex c of
513− 2 -> k (z SwaggerItemsObject)
514− 3 -> k (z SwaggerItemsArray)
515− _ -> error $ "Data.Data.gunfold: Constructor " ++ show c ++ " is not of type (SwaggerItems SwaggerKindSchema)."
516−
517− toConstr (SwaggerItemsPrimitive _ _) = error "Not supported"
518− toConstr (SwaggerItemsObject _) = swaggerItemsObjectConstr
519− toConstr (SwaggerItemsArray _) = swaggerItemsArrayConstr
520−
521− dataTypeOf _ = swaggerItemsDataType
522−
523−-- | Type used as a kind to avoid overlapping instances.
524−data SwaggerKind t
525− = SwaggerKindNormal t
526− | SwaggerKindParamOtherSchema
527− | SwaggerKindSchema
528− deriving (Typeable)
529−
530−deriving instance Typeable 'SwaggerKindNormal
531−deriving instance Typeable 'SwaggerKindParamOtherSchema
532−deriving instance Typeable 'SwaggerKindSchema
533−
534−-- TODO remove
535−type family SwaggerKindType (k :: SwaggerKind *) :: *
536−type instance SwaggerKindType ('SwaggerKindNormal t) = t
537−type instance SwaggerKindType 'SwaggerKindSchema = Schema
538−--type instance SwaggerKindType 'SwaggerKindParamOtherSchema = ParamOtherSchema
539−
540−data SwaggerType t where
541− SwaggerString :: SwaggerType t
542− SwaggerNumber :: SwaggerType t
543− SwaggerInteger :: SwaggerType t
544− SwaggerBoolean :: SwaggerType t
545− SwaggerArray :: SwaggerType t
546− SwaggerFile :: SwaggerType 'SwaggerKindParamOtherSchema
547− SwaggerNull :: SwaggerType 'SwaggerKindSchema
548− SwaggerObject :: SwaggerType 'SwaggerKindSchema
549− deriving (Typeable)
550−
551−deriving instance Eq (SwaggerType t)
552−deriving instance Show (SwaggerType t)
553−
554−swaggerTypeConstr :: Data (SwaggerType t) => SwaggerType t -> Constr
555−swaggerTypeConstr t = mkConstr (dataTypeOf t) (show t) [] Prefix
556−
557−swaggerTypeDataType :: {- Data (SwaggerType t) => -} SwaggerType t -> DataType
558−swaggerTypeDataType _ = mkDataType "Data.Swagger.SwaggerType" swaggerTypeConstrs
559−
560−swaggerCommonTypes :: [SwaggerType k]
561−swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray]
562−
563−swaggerParamTypes :: [SwaggerType 'SwaggerKindParamOtherSchema]
564−swaggerParamTypes = swaggerCommonTypes ++ [SwaggerFile]
565−
566−swaggerSchemaTypes :: [SwaggerType 'SwaggerKindSchema]
567−swaggerSchemaTypes = swaggerCommonTypes ++ [error "SwaggerFile is invalid SwaggerType Schema", SwaggerNull, SwaggerObject]
568−
569−swaggerTypeConstrs :: [Constr]
570−swaggerTypeConstrs = map swaggerTypeConstr (swaggerCommonTypes :: [SwaggerType 'SwaggerKindSchema])
571− ++ [swaggerTypeConstr SwaggerFile, swaggerTypeConstr SwaggerNull, swaggerTypeConstr SwaggerObject]
572−
573−instance Typeable t => Data (SwaggerType ('SwaggerKindNormal t)) where
574− gunfold = gunfoldEnum "SwaggerType" swaggerCommonTypes
575− toConstr = swaggerTypeConstr
576− dataTypeOf = swaggerTypeDataType
577−
578−instance Data (SwaggerType 'SwaggerKindParamOtherSchema) where
579− gunfold = gunfoldEnum "SwaggerType ParamOtherSchema" swaggerParamTypes
580− toConstr = swaggerTypeConstr
581− dataTypeOf = swaggerTypeDataType
582−
583−instance Data (SwaggerType 'SwaggerKindSchema) where
584− gunfold = gunfoldEnum "SwaggerType Schema" swaggerSchemaTypes
585− toConstr = swaggerTypeConstr
586− dataTypeOf = swaggerTypeDataType
514+data SwaggerItems where
515+ SwaggerItemsObject :: Referenced Schema -> SwaggerItems
516+ SwaggerItemsArray :: [Referenced Schema] -> SwaggerItems
517+ deriving (Eq, Show, Typeable, Data)
518+
519+data SwaggerType where
520+ SwaggerString :: SwaggerType
521+ SwaggerNumber :: SwaggerType
522+ SwaggerInteger :: SwaggerType
523+ SwaggerBoolean :: SwaggerType
524+ SwaggerArray :: SwaggerType
525+ SwaggerNull :: SwaggerType
526+ SwaggerObject :: SwaggerType
527+ deriving (Eq, Show, Typeable, Generic, Data)
587528
588529data ParamLocation
589530 = -- | Parameters that are appended to the URL.
@@ -601,42 +542,6 @@ data ParamLocation
601542
602543type Format = Text
603544
604−-- | Determines the format of the array.
605−data CollectionFormat t where
606− -- Comma separated values: @foo,bar@.
607− CollectionCSV :: CollectionFormat t
608− -- Space separated values: @foo bar@.
609− CollectionSSV :: CollectionFormat t
610− -- Tab separated values: @foo\\tbar@.
611− CollectionTSV :: CollectionFormat t
612− -- Pipe separated values: @foo|bar@.
613− CollectionPipes :: CollectionFormat t
614− -- Corresponds to multiple parameter instances
615− -- instead of multiple values for a single instance @foo=bar&foo=baz@.
616− -- This is valid only for parameters in @'ParamQuery'@ or @'ParamFormData'@.
617− CollectionMulti :: CollectionFormat 'SwaggerKindParamOtherSchema
618− deriving (Typeable)
619−
620−deriving instance Eq (CollectionFormat t)
621−deriving instance Show (CollectionFormat t)
622−
623−collectionFormatConstr :: CollectionFormat t -> Constr
624−collectionFormatConstr cf = mkConstr collectionFormatDataType (show cf) [] Prefix
625−
626−collectionFormatDataType :: DataType
627−collectionFormatDataType = mkDataType "Data.Swagger.CollectionFormat" $
628− map collectionFormatConstr collectionCommonFormats
629−
630−collectionCommonFormats :: [CollectionFormat t]
631−collectionCommonFormats = [ CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes ]
632−
633−instance Data t => Data (CollectionFormat ('SwaggerKindNormal t)) where
634− gunfold = gunfoldEnum "CollectionFormat" collectionCommonFormats
635− toConstr = collectionFormatConstr
636− dataTypeOf _ = collectionFormatDataType
637−
638−deriving instance Data (CollectionFormat 'SwaggerKindParamOtherSchema)
639−
640545type ParamName = Text
641546
642547data Schema = Schema
@@ -663,7 +568,7 @@ data Schema = Schema
663568 , _schemaMaxProperties :: Maybe Integer
664569 , _schemaMinProperties :: Maybe Integer
665570
666− , _schemaParamSchema :: ParamSchema 'SwaggerKindSchema
571+ , _schemaParamSchema :: ParamSchema
667572 } deriving (Eq, Show, Generic, Data, Typeable)
668573
669574data Discriminator = Discriminator
@@ -684,7 +589,7 @@ data NamedSchema = NamedSchema
684589-- | Regex pattern for @string@ type.
685590type Pattern = Text
686591
687−data ParamSchema (t :: SwaggerKind *) = ParamSchema
592+data ParamSchema = ParamSchema
688593 { -- | Declares the value of the parameter that the server will use if none is provided,
689594 -- for example a @"count"@ to control the number of results per page might default to @100@
690595 -- if not supplied by the client in the request.
@@ -692,9 +597,9 @@ data ParamSchema (t :: SwaggerKind *) = ParamSchema
692597 -- Unlike JSON Schema this value MUST conform to the defined type for this parameter.
693598 _paramSchemaDefault :: Maybe Value
694599
695− , _paramSchemaType :: Maybe (SwaggerType t)
600+ , _paramSchemaType :: Maybe SwaggerType
696601 , _paramSchemaFormat :: Maybe Format
697− , _paramSchemaItems :: Maybe (SwaggerItems t)
602+ , _paramSchemaItems :: Maybe SwaggerItems
698603 , _paramSchemaMaximum :: Maybe Scientific
699604 , _paramSchemaExclusiveMaximum :: Maybe Bool
700605 , _paramSchemaMinimum :: Maybe Scientific
@@ -707,9 +612,7 @@ data ParamSchema (t :: SwaggerKind *) = ParamSchema
707612 , _paramSchemaUniqueItems :: Maybe Bool
708613 , _paramSchemaEnum :: Maybe [Value]
709614 , _paramSchemaMultipleOf :: Maybe Scientific
710− } deriving (Eq, Show, Generic, Typeable)
711−
712−deriving instance (Typeable k, Data (Maybe (SwaggerType k)), Data (SwaggerItems k)) => Data (ParamSchema k)
615+ } deriving (Eq, Show, Generic, Typeable, Data)
713616
714617data Xml = Xml
715618 { -- | Replaces the name of the element/attribute used for the described schema property.
@@ -779,11 +682,13 @@ instance IsString Response where
779682
780683type HeaderName = Text
781684
685+
686+-- TODO this is mostly a copy of 'Param'.
782687data Header = Header
783688 { -- | A short description of the header.
784689 _headerDescription :: Maybe Text
785690
786− , _headerSchema :: ParamSchema ('SwaggerKindNormal Header)
691+ , _headerSchema :: Maybe (Referenced Schema)
787692 } deriving (Eq, Show, Generic, Data, Typeable)
788693
789694-- | The location of the API key.
@@ -993,9 +898,9 @@ instance Monoid Schema where
993898 mempty = genericMempty
994899 mappend = (<>)
995900
996−instance Semigroup (ParamSchema t) where
901+instance Semigroup ParamSchema where
997902 (<>) = genericMappend
998−instance Monoid (ParamSchema t) where
903+instance Monoid ParamSchema where
999904 mempty = genericMempty
1000905 mappend = (<>)
1001906
@@ -1093,7 +998,7 @@ instance SwaggerMonoid Info
1093998instance SwaggerMonoid Components
1094999instance SwaggerMonoid PathItem
10951000instance SwaggerMonoid Schema
1096−instance SwaggerMonoid (ParamSchema t)
1001+instance SwaggerMonoid ParamSchema
10971002instance SwaggerMonoid Param
10981003instance SwaggerMonoid Responses
10991004instance SwaggerMonoid Response
@@ -1104,7 +1009,7 @@ instance (Eq a, Hashable a) => SwaggerMonoid (InsOrdHashSet a)
11041009instance SwaggerMonoid MimeList
11051010deriving instance SwaggerMonoid URL
11061011
1107−instance SwaggerMonoid (SwaggerType t) where
1012+instance SwaggerMonoid SwaggerType where
11081013 swaggerMempty = SwaggerString
11091014 swaggerMappend _ y = y
11101015
@@ -1125,6 +1030,12 @@ instance Monoid a => SwaggerMonoid (Referenced a) where
11251030-- Simple Generic-based ToJSON instances
11261031-- =======================================================================
11271032
1033+instance ToJSON Style where
1034+ toJSON = genericToJSON (jsonPrefix "Style")
1035+
1036+instance ToJSON SwaggerType where
1037+ toJSON = genericToJSON (jsonPrefix "Swagger")
1038+
11281039instance ToJSON ParamLocation where
11291040 toJSON = genericToJSON (jsonPrefix "Param")
11301041
@@ -1174,6 +1085,12 @@ instance ToJSON OAuth2AuthorizationCodeFlow where
11741085-- Simple Generic-based FromJSON instances
11751086-- =======================================================================
11761087
1088+instance FromJSON Style where
1089+ parseJSON = genericParseJSON (jsonPrefix "Style")
1090+
1091+instance FromJSON SwaggerType where
1092+ parseJSON = genericParseJSON (jsonPrefix "Swagger")
1093+
11771094instance FromJSON ParamLocation where
11781095 parseJSON = genericParseJSON (jsonPrefix "Param")
11791096
@@ -1272,10 +1189,7 @@ instance ToJSON Header where
12721189-- >>> encode (SwaggerItemsArray [])
12731190-- "{\"example\":[],\"items\":{},\"maxItems\":0}"
12741191--
1275−instance ToJSON (ParamSchema t) => ToJSON (SwaggerItems t) where
1276− toJSON (SwaggerItemsPrimitive fmt schema) = object
1277− [ "collectionFormat" .= fmt
1278− , "items" .= schema ]
1192+instance ToJSON SwaggerItems where
12791193 toJSON (SwaggerItemsObject x) = object [ "items" .= x ]
12801194 toJSON (SwaggerItemsArray []) = object
12811195 [ "items" .= object []
@@ -1344,24 +1258,7 @@ instance ToJSON (Referenced RequestBody) where toJSON = referencedToJSON "#/comp
13441258instance ToJSON (Referenced Example) where toJSON = referencedToJSON "#/components/examples/"
13451259instance ToJSON (Referenced Header) where toJSON = referencedToJSON "#/components/headers/"
13461260
1347−instance ToJSON (SwaggerType t) where
1348− toJSON SwaggerArray = "array"
1349− toJSON SwaggerString = "string"
1350− toJSON SwaggerInteger = "integer"
1351− toJSON SwaggerNumber = "number"
1352− toJSON SwaggerBoolean = "boolean"
1353− toJSON SwaggerFile = "file"
1354− toJSON SwaggerNull = "null"
1355− toJSON SwaggerObject = "object"
1356−
1357−instance ToJSON (CollectionFormat t) where
1358− toJSON CollectionCSV = "csv"
1359− toJSON CollectionSSV = "ssv"
1360− toJSON CollectionTSV = "tsv"
1361− toJSON CollectionPipes = "pipes"
1362− toJSON CollectionMulti = "multi"
1363−
1364−instance ToJSON (ParamSchema k) where
1261+instance ToJSON ParamSchema where
13651262 -- TODO: this is a bit fishy, why we need sub object only in `ToJSON`?
13661263 toJSON = sopSwaggerGenericToJSONWithOpts $
13671264 mkSwaggerAesonOptions "paramSchema" & saoSubObject ?~ "items"
@@ -1412,28 +1309,7 @@ instance FromJSON Schema where
14121309instance FromJSON Header where
14131310 parseJSON = sopSwaggerGenericParseJSON
14141311
1415−instance (FromJSON (CollectionFormat ('SwaggerKindNormal t)), FromJSON (ParamSchema ('SwaggerKindNormal t))) => FromJSON (SwaggerItems ('SwaggerKindNormal t)) where
1416− parseJSON = withObject "SwaggerItemsPrimitive" $ \o -> SwaggerItemsPrimitive
1417− <$> o .:? "collectionFormat"
1418− <*> (o .: "items" >>= parseJSON)
1419−
1420−instance FromJSON (SwaggerItems 'SwaggerKindParamOtherSchema) where
1421− parseJSON = withObject "SwaggerItemsPrimitive" $ \o -> SwaggerItemsPrimitive
1422− <$> o .:? "collectionFormat"
1423− <*> ((o .: "items" >>= parseJSON) <|> fail ("foo" ++ show o))
1424−
1425−-- |
1426−--
1427−-- >>> decode "{}" :: Maybe (SwaggerItems 'SwaggerKindSchema)
1428−-- Just (SwaggerItemsArray [])
1429−--
1430−-- >>> eitherDecode "{\"$ref\":\"#/components/schemas/example\"}" :: Either String (SwaggerItems 'SwaggerKindSchema)
1431−-- Right (SwaggerItemsObject (Ref (Reference {getReference = "example"})))
1432−--
1433−-- >>> eitherDecode "[{\"$ref\":\"#/components/schemas/example\"}]" :: Either String (SwaggerItems 'SwaggerKindSchema)
1434−-- Right (SwaggerItemsArray [Ref (Reference {getReference = "example"})])
1435−--
1436−instance FromJSON (SwaggerItems 'SwaggerKindSchema) where
1312+instance FromJSON SwaggerItems where
14371313 parseJSON js@(Object obj)
14381314 | null obj = pure $ SwaggerItemsArray [] -- Nullary schema.
14391315 | otherwise = SwaggerItemsObject <$> parseJSON js
@@ -1506,30 +1382,7 @@ instance FromJSON (Referenced Header) where parseJSON = referencedParseJSON "#
15061382instance FromJSON Xml where
15071383 parseJSON = genericParseJSON (jsonPrefix "xml")
15081384
1509−instance FromJSON (SwaggerType 'SwaggerKindSchema) where
1510− parseJSON = parseOneOf [SwaggerString, SwaggerInteger, SwaggerNumber, SwaggerBoolean, SwaggerArray, SwaggerNull, SwaggerObject]
1511−
1512−instance FromJSON (SwaggerType 'SwaggerKindParamOtherSchema) where
1513− parseJSON = parseOneOf [SwaggerString, SwaggerInteger, SwaggerNumber, SwaggerBoolean, SwaggerArray, SwaggerFile]
1514−
1515−instance FromJSON (SwaggerType ('SwaggerKindNormal t)) where
1516− parseJSON = parseOneOf [SwaggerString, SwaggerInteger, SwaggerNumber, SwaggerBoolean, SwaggerArray]
1517−
1518−instance FromJSON (CollectionFormat ('SwaggerKindNormal t)) where
1519− parseJSON = parseOneOf [CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes]
1520−
1521−-- NOTE: There aren't collections of 'Schema'
1522−--instance FromJSON (CollectionFormat (SwaggerKindSchema)) where
1523−-- parseJSON = parseOneOf [CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes]
1524−
1525−instance FromJSON (CollectionFormat 'SwaggerKindParamOtherSchema) where
1526− parseJSON = parseOneOf [CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes, CollectionMulti]
1527−
1528−instance (FromJSON (SwaggerType ('SwaggerKindNormal t)), FromJSON (SwaggerItems ('SwaggerKindNormal t))) => FromJSON (ParamSchema ('SwaggerKindNormal t)) where
1529− parseJSON = sopSwaggerGenericParseJSON
1530−instance FromJSON (ParamSchema 'SwaggerKindParamOtherSchema) where
1531− parseJSON = sopSwaggerGenericParseJSON
1532−instance FromJSON (ParamSchema 'SwaggerKindSchema) where
1385+instance FromJSON ParamSchema where
15331386 parseJSON = sopSwaggerGenericParseJSON
15341387
15351388instance FromJSON AdditionalProperties where
@@ -1571,17 +1424,12 @@ instance HasSwaggerAesonOptions Example where
15711424instance HasSwaggerAesonOptions Encoding where
15721425 swaggerAesonOptions _ = mkSwaggerAesonOptions "encoding"
15731426
1574−instance HasSwaggerAesonOptions (ParamSchema ('SwaggerKindNormal t)) where
1575− swaggerAesonOptions _ = mkSwaggerAesonOptions "paramSchema" & saoSubObject ?~ "items"
1576−instance HasSwaggerAesonOptions (ParamSchema 'SwaggerKindParamOtherSchema) where
1577− swaggerAesonOptions _ = mkSwaggerAesonOptions "paramSchema" & saoSubObject ?~ "items"
1578−-- NOTE: Schema doesn't have 'items' sub object!
1579−instance HasSwaggerAesonOptions (ParamSchema 'SwaggerKindSchema) where
1427+instance HasSwaggerAesonOptions ParamSchema where
15801428 swaggerAesonOptions _ = mkSwaggerAesonOptions "paramSchema"
15811429
15821430instance AesonDefaultValue Server
15831431instance AesonDefaultValue Components
1584−instance AesonDefaultValue (ParamSchema s)
1432+instance AesonDefaultValue ParamSchema
15851433instance AesonDefaultValue OAuth2ImplicitFlow
15861434instance AesonDefaultValue OAuth2PasswordFlow
15871435instance AesonDefaultValue OAuth2ClientCredentialsFlow
@@ -1589,7 +1437,7 @@ instance AesonDefaultValue OAuth2AuthorizationCodeFlow
15891437instance AesonDefaultValue p => AesonDefaultValue (OAuth2Flow p)
15901438instance AesonDefaultValue Responses
15911439instance AesonDefaultValue SecuritySchemeType
1592−instance AesonDefaultValue (SwaggerType a)
1440+instance AesonDefaultValue SwaggerType
15931441instance AesonDefaultValue MimeList where defaultValue = Just mempty
15941442instance AesonDefaultValue Info
15951443instance AesonDefaultValue ParamLocation