@@ -68,56 +68,28 @@ data Swagger = Swagger
6868 -- The metadata can be used by the clients if needed.
6969 _swaggerInfo :: Info
7070
71− -- | The host (name or ip) serving the API. It MAY include a port.
72− -- If the host is not included, the host serving the documentation is to be used (including the port).
73− , _swaggerHost :: Maybe Host
74−
75− -- | The base path on which the API is served, which is relative to the host.
76− -- If it is not included, the API is served directly under the host.
77− -- The value MUST start with a leading slash (/).
78− , _swaggerBasePath :: Maybe FilePath
79−
80− -- | The transfer protocol of the API.
81− -- If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.
82− , _swaggerSchemes :: Maybe [Scheme]
83−
84− -- | A list of MIME types the APIs can consume.
85− -- This is global to all APIs but can be overridden on specific API calls.
86− , _swaggerConsumes :: MimeList
87−
88− -- | A list of MIME types the APIs can produce.
89− -- This is global to all APIs but can be overridden on specific API calls.
90− , _swaggerProduces :: MimeList
71+ -- | An array of Server Objects, which provide connectivity information
72+ -- to a target server. If the servers property is not provided, or is an empty array,
73+ -- the default value would be a 'Server' object with a url value of @/@.
74+ , _swaggerServers :: [Server]
9175
9276 -- | The available paths and operations for the API.
93− -- Holds the relative paths to the individual endpoints.
94− -- The path is appended to the @'basePath'@ in order to construct the full URL.
9577 , _swaggerPaths :: InsOrdHashMap FilePath PathItem
9678
97− -- | An object to hold data types produced and consumed by operations.
98− , _swaggerDefinitions :: Definitions Schema
79+ -- | An element to hold various schemas for the specification.
80+ , _swaggerComponents :: Components
9981
100− -- | An object to hold parameters that can be used across operations.
101− -- This property does not define global parameters for all operations.
102− , _swaggerParameters :: Definitions Param
103−
104− -- | An object to hold responses that can be used across operations.
105− -- This property does not define global responses for all operations.
106− , _swaggerResponses :: Definitions Response
107−
108− -- | Security scheme definitions that can be used across the specification.
109− , _swaggerSecurityDefinitions :: SecurityDefinitions
110−
111− -- | A declaration of which security schemes are applied for the API as a whole.
112− -- The list of values describes alternative security schemes that can be used
113− -- (that is, there is a logical OR between the security requirements).
82+ -- | A declaration of which security mechanisms can be used across the API.
83+ -- The list of values includes alternative security requirement objects that can be used.
84+ -- Only one of the security requirement objects need to be satisfied to authorize a request.
11485 -- Individual operations can override this definition.
86+ -- To make security optional, an empty security requirement can be included in the array.
11587 , _swaggerSecurity :: [SecurityRequirement]
11688
11789 -- | A list of tags used by the specification with additional metadata.
11890 -- The order of the tags can be used to reflect on their order by the parsing tools.
119− -- Not all tags that are used by the Operation Object must be declared.
120− -- The tags that are not declared may be organized randomly or based on the tools' logic.
91+ -- Not all tags that are used by the 'Operation' Object must be declared.
92+ -- The tags that are not declared MAY be organized randomly or based on the tools' logic.
12193 -- Each tag name in the list MUST be unique.
12294 , _swaggerTags :: InsOrdHashSet Tag
12395
@@ -126,17 +98,17 @@ data Swagger = Swagger
12698 } deriving (Eq, Show, Generic, Data, Typeable)
12799
128100-- | The object provides metadata about the API.
129−-- The metadata can be used by the clients if needed,
130−-- and can be presented in the Swagger-UI for convenience.
101+-- The metadata MAY be used by the clients if needed,
102+-- and MAY be presented in editing or documentation generation tools for convenience.
131103data Info = Info
132− { -- | The title of the application.
104+ { -- | The title of the API.
133105 _infoTitle :: Text
134106
135− -- | A short description of the application.
136− -- GFM syntax can be used for rich text representation.
107+ -- | A short description of the API.
108+ -- [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
137109 , _infoDescription :: Maybe Text
138110
139− -- | The Terms of Service for the API.
111+ -- | A URL to the Terms of Service for the API. MUST be in the format of a URL.
140112 , _infoTermsOfService :: Maybe Text
141113
142114 -- | The contact information for the exposed API.
@@ -145,8 +117,8 @@ data Info = Info
145117 -- | The license information for the exposed API.
146118 , _infoLicense :: Maybe License
147119
148− -- | Provides the version of the application API
149− -- (not to be confused with the specification version).
120+ -- | The version of the OpenAPI document (which is distinct from the
121+ -- OpenAPI Specification version or the API implementation version).
150122 , _infoVersion :: Text
151123 } deriving (Eq, Show, Generic, Data, Typeable)
152124
@@ -174,6 +146,54 @@ data License = License
174146instance IsString License where
175147 fromString s = License (fromString s) Nothing
176148
149+-- | An object representing a Server.
150+data Server = Server
151+ { -- | A URL to the target host. This URL supports Server Variables and MAY be relative,
152+ -- to indicate that the host location is relative to the location where
153+ -- the OpenAPI document is being served. Variable substitutions will be made when
154+ -- a variable is named in @{brackets}@.
155+ _serverUrl :: Text
156+
157+ -- | An optional string describing the host designated by the URL.
158+ -- [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
159+ , _serverDescription :: Maybe Text
160+
161+ -- | A map between a variable name and its value.
162+ -- The value is used for substitution in the server's URL template.
163+ , _serverVariables :: InsOrdHashMap Text ServerVariable
164+ } deriving (Eq, Show, Generic, Data, Typeable)
165+
166+data ServerVariable = ServerVariable
167+ { -- | An enumeration of string values to be used if the substitution options
168+ -- are from a limited set. The array SHOULD NOT be empty.
169+ _serverVariableEnum :: Maybe (InsOrdHashSet Text) -- TODO NonEmpty
170+
171+ -- | The default value to use for substitution, which SHALL be sent if an alternate value
172+ -- is not supplied. Note this behavior is different than the 'Schema\ Object's treatment
173+ -- of default values, because in those cases parameter values are optional.
174+ -- If the '_serverVariableEnum' is defined, the value SHOULD exist in the enum's values.
175+ , _serverVariableDefault :: Text
176+
177+ -- | An optional description for the server variable.
178+ -- [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
179+ , _serverVariableDescription :: Maybe Text
180+ } deriving (Eq, Show, Generic, Data, Typeable)
181+
182+-- | Holds a set of reusable objects for different aspects of the OAS.
183+-- All objects defined within the components object will have no effect on the API
184+-- unless they are explicitly referenced from properties outside the components object.
185+data Components = Components
186+ { _componentsSchemas :: Definitions Schema -- TODO check Schema itself
187+ , _componentsResponses :: Definitions Response
188+ , _componentsParameters :: Definitions Param
189+-- , _componentsExamples
190+ , _componentsRequestBodies :: Definitions RequestBody
191+ , _componentsHeader :: Definitions Header
192+ , _componentsSecuritySchemes :: Definitions SecurityScheme
193+-- , _componentsLinks
194+-- , _componentsCallbacks
195+ } deriving (Eq, Show, Generic, Data, Typeable)
196+
177197-- | The host (name or ip) serving the API. It MAY include a port.
178198data Host = Host
179199 { _hostName :: HostName -- ^ Host name.
@@ -209,8 +229,15 @@ data Scheme
209229-- The path itself is still exposed to the documentation viewer
210230-- but they will not know which operations and parameters are available.
211231data PathItem = PathItem
212− { -- | A definition of a GET operation on this path.
213− _pathItemGet :: Maybe Operation
232+ { -- | An optional, string summary, intended to apply to all operations in this path.
233+ _pathItemSummary :: Maybe Text
234+
235+ -- | An optional, string description, intended to apply to all operations in this path.
236+ -- [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
237+ , _pathItemDescription :: Maybe Text
238+
239+ -- | A definition of a GET operation on this path.
240+ , _pathItemGet :: Maybe Operation
214241
215242 -- | A definition of a PUT operation on this path.
216243 , _pathItemPut :: Maybe Operation
@@ -230,6 +257,12 @@ data PathItem = PathItem
230257 -- | A definition of a PATCH operation on this path.
231258 , _pathItemPatch :: Maybe Operation
232259
260+ -- | A definition of a TRACE operation on this path.
261+ , _pathItemTrace :: Maybe Operation
262+
263+ -- | An alternative server array to service all operations in this path.
264+ , _pathItemServers :: [Server]
265+
233266 -- | A list of parameters that are applicable for all the operations described under this path.
234267 -- These parameters can be overridden at the operation level, but cannot be removed there.
235268 -- The list MUST NOT include duplicated parameters.
@@ -248,7 +281,7 @@ data Operation = Operation
248281 , _operationSummary :: Maybe Text
249282
250283 -- | A verbose explanation of the operation behavior.
251− -- GFM syntax can be used for rich text representation.
284+ -- [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.
252285 , _operationDescription :: Maybe Text
253286
254287 -- | Additional external documentation for this operation.
@@ -256,20 +289,11 @@ data Operation = Operation
256289
257290 -- | Unique string used to identify the operation.
258291 -- The id MUST be unique among all operations described in the API.
259− -- Tools and libraries MAY use the it to uniquely identify an operation,
260− -- therefore, it is recommended to follow common programming naming conventions.
292+ -- The operationId value is **case-sensitive**.
293+ -- Tools and libraries MAY use the operationId to uniquely identify an operation, therefore,
294+ -- it is RECOMMENDED to follow common programming naming conventions.
261295 , _operationOperationId :: Maybe Text
262296
263− -- | A list of MIME types the operation can consume.
264− -- This overrides the @'consumes'@.
265− -- @Just []@ MAY be used to clear the global definition.
266− , _operationConsumes :: Maybe MimeList
267−
268− -- | A list of MIME types the operation can produce.
269− -- This overrides the @'produces'@.
270− -- @Just []@ MAY be used to clear the global definition.
271− , _operationProduces :: Maybe MimeList
272−
273297 -- | A list of parameters that are applicable for this operation.
274298 -- If a parameter is already defined at the @'PathItem'@,
275299 -- the new definition will override it, but can never remove it.
@@ -277,12 +301,17 @@ data Operation = Operation
277301 -- A unique parameter is defined by a combination of a name and location.
278302 , _operationParameters :: [Referenced Param]
279303
304+ -- | The request body applicable for this operation.
305+ -- The requestBody is only supported in HTTP methods where the HTTP 1.1
306+ -- specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1)
307+ -- has explicitly defined semantics for request bodies.
308+ -- In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.
309+ , _operationRequestBody :: Maybe (Referenced RequestBody)
310+
280311 -- | The list of possible responses as they are returned from executing this operation.
281312 , _operationResponses :: Responses
282313
283− -- | The transfer protocol for the operation.
284− -- The value overrides @'schemes'@.
285− , _operationSchemes :: Maybe [Scheme]
314+ -- TODO callbacks
286315
287316 -- | Declares this operation to be deprecated.
288317 -- Usage of the declared operation should be refrained.
@@ -295,6 +324,37 @@ data Operation = Operation
295324 -- This definition overrides any declared top-level security.
296325 -- To remove a top-level security declaration, @Just []@ can be used.
297326 , _operationSecurity :: [SecurityRequirement]
327+
328+ -- | An alternative server array to service this operation.
329+ -- If an alternative server object is specified at the 'PathItem' Object or Root level,
330+ -- it will be overridden by this value.
331+ , _operationServers :: [Server]
332+ } deriving (Eq, Show, Generic, Data, Typeable)
333+
334+-- | Describes a single request body.
335+data RequestBody = RequestBody
336+ { -- | A brief description of the request body. This could contain examples of use.
337+ -- [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
338+ _requestBodyDescription :: Maybe Text
339+
340+ -- | The content of the request body.
341+ -- The key is a media type or media type range and the value describes it.
342+ -- For requests that match multiple keys, only the most specific key is applicable.
343+ -- e.g. @text/plain@ overrides @text/*@
344+ , _requestBodyContent :: InsOrdHashMap {-MediaType-} Text MediaTypeObject -- FIXME Data MediaType
345+
346+ , _requestBodyRequired :: Maybe Bool
347+ } deriving (Eq, Show, Generic, Data, Typeable)
348+
349+-- | Each Media Type Object provides schema and examples for the media type identified by its key.
350+data MediaTypeObject = MediaTypeObject
351+ { _mediaTypeSchema :: Maybe (Referenced Schema)
352+
353+-- TODO
354+-- , _mediaTypeExample
355+-- , _mediaTypeExamples
356+
357+-- , _mediaTypeEncoding :: InsOrdHashMap Text Encoding
298358 } deriving (Eq, Show, Generic, Data, Typeable)
299359
300360newtype MimeList = MimeList { getMimeList :: [MediaType] }
@@ -494,14 +554,8 @@ data ParamLocation
494554 -- This does not include the host or base path of the API.
495555 -- For example, in @/items/{itemId}@, the path parameter is @itemId@.
496556 | ParamPath
497− -- | Used to describe the payload of an HTTP request when either @application/x-www-form-urlencoded@
498− -- or @multipart/form-data@ are used as the content type of the request
499− -- (in Swagger's definition, the @consumes@ property of an operation).
500− -- This is the only parameter type that can be used to send files, thus supporting the @'ParamFile'@ type.
501− -- Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation.
502− -- Form parameters have a different format based on the content-type used
503− -- (for further details, consult <http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4>).
504− | ParamFormData
557+ -- | Used to pass a specific cookie value to the API.
558+ | ParamCookie
505559 deriving (Eq, Show, Generic, Data, Typeable)
506560
507561type Format = Text
@@ -650,25 +704,23 @@ type HttpStatusCode = Int
650704-- | Describes a single response from an API Operation.
651705data Response = Response
652706 { -- | A short description of the response.
653− -- GFM syntax can be used for rich text representation.
707+ -- [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.
654708 _responseDescription :: Text
655709
656− -- | A definition of the response structure.
657− -- It can be a primitive, an array or an object.
658− -- If this field does not exist, it means no content is returned as part of the response.
659− -- As an extension to the Schema Object, its root type value may also be "file".
660− -- This SHOULD be accompanied by a relevant produces mime-type.
661− , _responseSchema :: Maybe (Referenced Schema)
710+ -- | A map containing descriptions of potential response payloads.
711+ -- The key is a media type or media type range and the value describes it.
712+ -- For responses that match multiple keys, only the most specific key is applicable.
713+ -- e.g. @text/plain@ overrides @text/*@.
714+ , _responseContent :: InsOrdHashMap Text MediaTypeObject
662715
663− -- | A list of headers that are sent with the response.
664− , _responseHeaders :: InsOrdHashMap HeaderName Header
716+ -- | Maps a header name to its definition.
717+ , _responseHeaders :: InsOrdHashMap HeaderName Header -- FIXME Referenced
665718
666− -- | An example of the response message.
667− , _responseExamples :: Maybe Example
719+ -- TODO links
668720 } deriving (Eq, Show, Generic, Data, Typeable)
669721
670722instance IsString Response where
671− fromString s = Response (fromString s) Nothing mempty Nothing
723+ fromString s = Response (fromString s) mempty mempty
672724
673725type HeaderName = Text
674726
@@ -699,6 +751,7 @@ instance Data Example where
699751data ApiKeyLocation
700752 = ApiKeyQuery
701753 | ApiKeyHeader
754+ | ApiKeyCookie
702755 deriving (Eq, Show, Generic, Data, Typeable)
703756
704757data ApiKeyParams = ApiKeyParams
@@ -731,9 +784,10 @@ data OAuth2Params = OAuth2Params
731784 } deriving (Eq, Show, Generic, Data, Typeable)
732785
733786data SecuritySchemeType
734− = SecuritySchemeBasic
787+ = SecuritySchemeHttp
735788 | SecuritySchemeApiKey ApiKeyParams
736789 | SecuritySchemeOAuth2 OAuth2Params
790+-- | SecuritySchemeOpenIdConnect -- FIXME
737791 deriving (Eq, Show, Generic, Data, Typeable)
738792
739793data SecurityScheme = SecurityScheme
@@ -825,6 +879,7 @@ data AdditionalProperties
825879-- Generic instances
826880-------------------------------------------------------------------------------
827881
882+deriveGeneric ''Components
828883deriveGeneric ''Header
829884deriveGeneric ''OAuth2Params
830885deriveGeneric ''Operation
@@ -832,6 +887,8 @@ deriveGeneric ''Param
832887deriveGeneric ''ParamOtherSchema
833888deriveGeneric ''PathItem
834889deriveGeneric ''Response
890+deriveGeneric ''RequestBody
891+deriveGeneric ''MediaTypeObject
835892deriveGeneric ''Responses
836893deriveGeneric ''SecurityScheme
837894deriveGeneric ''Schema
@@ -860,6 +917,12 @@ instance Monoid Contact where
860917 mempty = genericMempty
861918 mappend = (<>)
862919
920+instance Semigroup Components where
921+ (<>) = genericMappend
922+instance Monoid Components where
923+ mempty = genericMempty
924+ mappend = (<>)
925+
863926instance Semigroup PathItem where
864927 (<>) = genericMappend
865928instance Monoid PathItem where
@@ -942,6 +1005,7 @@ instance Monoid SecurityDefinitions where
9421005-- =======================================================================
9431006
9441007instance SwaggerMonoid Info
1008+instance SwaggerMonoid Components
9451009instance SwaggerMonoid PathItem
9461010instance SwaggerMonoid Schema
9471011instance SwaggerMonoid (ParamSchema t)
@@ -996,6 +1060,12 @@ instance ToJSON Contact where
9961060instance ToJSON License where
9971061 toJSON = genericToJSON (jsonPrefix "License")
9981062
1063+instance ToJSON Server where
1064+ toJSON = genericToJSON (jsonPrefix "Server")
1065+
1066+instance ToJSON ServerVariable where
1067+ toJSON = genericToJSON (jsonPrefix "ServerVariable")
1068+
9991069instance ToJSON ApiKeyLocation where
10001070 toJSON = genericToJSON (jsonPrefix "ApiKey")
10011071
@@ -1030,6 +1100,12 @@ instance FromJSON Contact where
10301100instance FromJSON License where
10311101 parseJSON = genericParseJSON (jsonPrefix "License")
10321102
1103+instance FromJSON Server where
1104+ parseJSON = genericParseJSON (jsonPrefix "Server")
1105+
1106+instance FromJSON ServerVariable where
1107+ parseJSON = genericParseJSON (jsonPrefix "ServerVariable")
1108+
10331109instance FromJSON ApiKeyLocation where
10341110 parseJSON = genericParseJSON (jsonPrefix "ApiKey")
10351111
@@ -1069,8 +1145,8 @@ instance ToJSON OAuth2Params where
10691145 toEncoding = sopSwaggerGenericToEncoding
10701146
10711147instance ToJSON SecuritySchemeType where
1072− toJSON SecuritySchemeBasic
1073− = object [ "type" .= ("basic" :: Text) ]
1148+ toJSON SecuritySchemeHttp
1149+ = object [ "type" .= ("http" :: Text) ]
10741150 toJSON (SecuritySchemeApiKey params)
10751151 = toJSON params
10761152 <+> object [ "type" .= ("apiKey" :: Text) ]
@@ -1115,6 +1191,10 @@ instance ToJSON (ParamSchema t) => ToJSON (SwaggerItems t) where
11151191 ]
11161192 toJSON (SwaggerItemsArray x) = object [ "items" .= x ]
11171193
1194+instance ToJSON Components where
1195+ toJSON = sopSwaggerGenericToJSON
1196+ toEncoding = sopSwaggerGenericToEncoding
1197+
11181198instance ToJSON Host where
11191199 toJSON (Host host mport) = toJSON $
11201200 case mport of
@@ -1152,6 +1232,14 @@ instance ToJSON PathItem where
11521232 toJSON = sopSwaggerGenericToJSON
11531233 toEncoding = sopSwaggerGenericToEncoding
11541234
1235+instance ToJSON RequestBody where
1236+ toJSON = sopSwaggerGenericToJSON
1237+ toEncoding = sopSwaggerGenericToEncoding
1238+
1239+instance ToJSON MediaTypeObject where
1240+ toJSON = sopSwaggerGenericToJSON
1241+ toEncoding = sopSwaggerGenericToEncoding
1242+
11551243instance ToJSON Example where
11561244 toJSON = toJSON . Map.mapKeys show . getExample
11571245
@@ -1165,9 +1253,11 @@ referencedToJSON :: ToJSON a => Text -> Referenced a -> Value
11651253referencedToJSON prefix (Ref (Reference ref)) = object [ "$ref" .= (prefix <> ref) ]
11661254referencedToJSON _ (Inline x) = toJSON x
11671255
1256+-- FIXME this stuff
11681257instance ToJSON (Referenced Schema) where toJSON = referencedToJSON "#/definitions/"
11691258instance ToJSON (Referenced Param) where toJSON = referencedToJSON "#/parameters/"
11701259instance ToJSON (Referenced Response) where toJSON = referencedToJSON "#/responses/"
1260+instance ToJSON (Referenced RequestBody) where toJSON = referencedToJSON "#/!!!!/"
11711261
11721262instance ToJSON (SwaggerType t) where
11731263 toJSON SwaggerArray = "array"
@@ -1219,7 +1309,7 @@ instance FromJSON SecuritySchemeType where
12191309 parseJSON js@(Object o) = do
12201310 (t :: Text) <- o .: "type"
12211311 case t of
1222− "basic" -> pure SecuritySchemeBasic
1312+ "http" -> pure SecuritySchemeHttp
12231313 "apiKey" -> SecuritySchemeApiKey <$> parseJSON js
12241314 "oauth2" -> SecuritySchemeOAuth2 <$> parseJSON js
12251315 _ -> empty
@@ -1271,6 +1361,9 @@ instance FromJSON (SwaggerItems 'SwaggerKindSchema) where
12711361 parseJSON js@(Array _) = SwaggerItemsArray <$> parseJSON js
12721362 parseJSON _ = empty
12731363
1364+instance FromJSON Components where
1365+ parseJSON = sopSwaggerGenericParseJSON
1366+
12741367instance FromJSON Host where
12751368 parseJSON (String s) = case map Text.unpack $ Text.split (== ':') s of
12761369 [host] -> return $ Host host Nothing
@@ -1319,6 +1412,12 @@ instance FromJSON Operation where
13191412instance FromJSON PathItem where
13201413 parseJSON = sopSwaggerGenericParseJSON
13211414
1415+instance FromJSON RequestBody where
1416+ parseJSON = sopSwaggerGenericParseJSON
1417+
1418+instance FromJSON MediaTypeObject where
1419+ parseJSON = sopSwaggerGenericParseJSON
1420+
13221421instance FromJSON SecurityDefinitions where
13231422 parseJSON js = SecurityDefinitions <$> parseJSON js
13241423
@@ -1339,9 +1438,11 @@ referencedParseJSON prefix js@(Object o) = do
13391438 Just suffix -> pure (Reference suffix)
13401439referencedParseJSON _ _ = fail "referenceParseJSON: not an object"
13411440
1441+-- FIXME this stuff
13421442instance FromJSON (Referenced Schema) where parseJSON = referencedParseJSON "#/definitions/"
13431443instance FromJSON (Referenced Param) where parseJSON = referencedParseJSON "#/parameters/"
13441444instance FromJSON (Referenced Response) where parseJSON = referencedParseJSON "#/responses/"
1445+instance FromJSON (Referenced RequestBody) where parseJSON = referencedParseJSON "#/!!!!/"
13451446
13461447instance FromJSON Xml where
13471448 parseJSON = genericParseJSON (jsonPrefix "xml")
@@ -1376,6 +1477,8 @@ instance FromJSON AdditionalProperties where
13761477 parseJSON (Bool b) = pure $ AdditionalPropertiesAllowed b
13771478 parseJSON js = AdditionalPropertiesSchema <$> parseJSON js
13781479
1480+instance HasSwaggerAesonOptions Components where
1481+ swaggerAesonOptions _ = mkSwaggerAesonOptions "components"
13791482instance HasSwaggerAesonOptions Header where
13801483 swaggerAesonOptions _ = mkSwaggerAesonOptions "header" & saoSubObject ?~ "paramSchema"
13811484instance HasSwaggerAesonOptions OAuth2Params where
@@ -1390,6 +1493,10 @@ instance HasSwaggerAesonOptions PathItem where
13901493 swaggerAesonOptions _ = mkSwaggerAesonOptions "pathItem"
13911494instance HasSwaggerAesonOptions Response where
13921495 swaggerAesonOptions _ = mkSwaggerAesonOptions "response"
1496+instance HasSwaggerAesonOptions RequestBody where
1497+ swaggerAesonOptions _ = mkSwaggerAesonOptions "requestBody"
1498+instance HasSwaggerAesonOptions MediaTypeObject where
1499+ swaggerAesonOptions _ = mkSwaggerAesonOptions "mediaType"
13931500instance HasSwaggerAesonOptions Responses where
13941501 swaggerAesonOptions _ = mkSwaggerAesonOptions "responses" & saoSubObject ?~ "responses"
13951502instance HasSwaggerAesonOptions SecurityScheme where
@@ -1397,7 +1504,7 @@ instance HasSwaggerAesonOptions SecurityScheme where
13971504instance HasSwaggerAesonOptions Schema where
13981505 swaggerAesonOptions _ = mkSwaggerAesonOptions "schema" & saoSubObject ?~ "paramSchema"
13991506instance HasSwaggerAesonOptions Swagger where
1400− swaggerAesonOptions _ = mkSwaggerAesonOptions "swagger" & saoAdditionalPairs .~ [("swagger", "2.0")]
1507+ swaggerAesonOptions _ = mkSwaggerAesonOptions "swagger" & saoAdditionalPairs .~ [("openapi", "3.0")]
14011508
14021509instance HasSwaggerAesonOptions (ParamSchema ('SwaggerKindNormal t)) where
14031510 swaggerAesonOptions _ = mkSwaggerAesonOptions "paramSchema" & saoSubObject ?~ "items"
@@ -1407,6 +1514,7 @@ instance HasSwaggerAesonOptions (ParamSchema 'SwaggerKindParamOtherSchema) where
14071514instance HasSwaggerAesonOptions (ParamSchema 'SwaggerKindSchema) where
14081515 swaggerAesonOptions _ = mkSwaggerAesonOptions "paramSchema"
14091516
1517+instance AesonDefaultValue Components
14101518instance AesonDefaultValue (ParamSchema s)
14111519instance AesonDefaultValue OAuth2Flow
14121520instance AesonDefaultValue Responses