git.iko.soy/typeable/openapi3
on master help sign in
Add data model for Responses object
commit9a5e6b9c727480c5f33f4d9db8b865e274dcc905 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateFri 6 Nov 2015, 17:48 (11 years ago) parentc8a260a
1 file changed+17
src/Data/Swagger/Internal.hs+17
src/Data/Swagger/Internal.hs+17
@@ -399,7 +399,24 @@ data SwaggerItems = SwaggerItems
399399 , swaggerItemsMultipleOf :: Maybe Integer
400400 } deriving (Show)
401401
402+-- | A container for the expected responses of an operation.
403+-- The container maps a HTTP response code to the expected response.
404+-- It is not expected from the documentation to necessarily cover all possible HTTP response codes,
405+-- since they may not be known in advance.
406+-- However, it is expected from the documentation to cover a successful operation response and any known errors.
402407data SwaggerResponses = SwaggerResponses
408+ { -- | The documentation of responses other than the ones declared for specific HTTP response codes.
409+ -- It can be used to cover undeclared responses.
410+ swaggerResponsesDefault :: SwaggerResponse
411+
412+ -- | Any HTTP status code can be used as the property name (one property per HTTP status code).
413+ -- Describes the expected response for those HTTP status codes.
414+ , swaggerResponsesResponses :: HashMap HttpStatusCode SwaggerResponse
415+ } deriving (Show)
416+
417+type HttpStatusCode = Int
418+
419+data SwaggerResponse = SwaggerResponse
403420 deriving (Show)
404421
405422data SwaggerExtension = SwaggerExtension