git.iko.soy/typeable/openapi3
on master help sign in
Add data model for Response object
commit4540135a659974cacc67ffbea2c02f6ed6e8ce05 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateFri 6 Nov 2015, 17:52 (11 years ago) parent9a5e6b9
1 file changed+24−1
src/Data/Swagger/Internal.hs+24−1
src/Data/Swagger/Internal.hs+24−1
@@ -407,7 +407,7 @@ data SwaggerItems = SwaggerItems
407407data SwaggerResponses = SwaggerResponses
408408 { -- | The documentation of responses other than the ones declared for specific HTTP response codes.
409409 -- It can be used to cover undeclared responses.
410− swaggerResponsesDefault :: SwaggerResponse
410+ swaggerResponsesDefault :: Maybe SwaggerResponse
411411
412412 -- | Any HTTP status code can be used as the property name (one property per HTTP status code).
413413 -- Describes the expected response for those HTTP status codes.
@@ -416,7 +416,30 @@ data SwaggerResponses = SwaggerResponses
416416
417417type HttpStatusCode = Int
418418
419+-- | Describes a single response from an API Operation.
419420data SwaggerResponse = SwaggerResponse
421+ { -- | A short description of the response.
422+ -- GFM syntax can be used for rich text representation.
423+ swaggerResponseDescription :: Text
424+
425+ -- | A definition of the response structure.
426+ -- It can be a primitive, an array or an object.
427+ -- If this field does not exist, it means no content is returned as part of the response.
428+ -- As an extension to the Schema Object, its root type value may also be "file".
429+ -- This SHOULD be accompanied by a relevant produces mime-type.
430+ , swaggerResponseSchema :: SwaggerSchema
431+
432+ -- | A list of headers that are sent with the response.
433+ , swaggerResponseHeaders :: SwaggerHeaders
434+
435+ -- | An example of the response message.
436+ , swaggerResponseExamples :: SwaggerExample
437+ } deriving (Show)
438+
439+data SwaggerHeaders = SwaggerHeaders
440+ deriving (Show)
441+
442+data SwaggerExample = SwaggerExample
420443 deriving (Show)
421444
422445data SwaggerExtension = SwaggerExtension