@@ -21,14 +21,6 @@ import Test.Hspec hiding (example)
22spec :: Spec
22spec :: Spec
25− it "can decode the host port" $ do
26− let h = Just $ Host "localhost" (Just (fromInteger 8000))
28− swagger = swaggerExample
30− parsed :: Swagger = either error id $ eitherDecode' $ encode swagger
31− parsed ^. host `shouldBe` h
32 describe "License Object" $ licenseExample <=> licenseExampleJSON
24 describe "License Object" $ licenseExample <=> licenseExampleJSON
33 describe "Contact Object" $ contactExample <=> contactExampleJSON
25 describe "Contact Object" $ contactExample <=> contactExampleJSON
34 describe "Info Object" $ infoExample <=> infoExampleJSON
26 describe "Info Object" $ infoExample <=> infoExampleJSON
@@ -48,9 +40,11 @@ spec = do
48 describe "Swagger Object" $ do
40 describe "Swagger Object" $ do
49 context "Example with no paths" $ emptyPathsFieldExample <=> emptyPathsFieldExampleJSON
41 context "Example with no paths" $ emptyPathsFieldExample <=> emptyPathsFieldExampleJSON
50 context "Todo Example" $ swaggerExample <=> swaggerExampleJSON
42 context "Todo Example" $ swaggerExample <=> swaggerExampleJSON
51− context "PetStore Example" $
43+ context "PetStore Example" $ do
52 it "decodes successfully" $ do
44 it "decodes successfully" $ do
53 fromJSON petstoreExampleJSON `shouldSatisfy` (\x -> case x of Success (_ :: Swagger) -> True; _ -> False)
45 fromJSON petstoreExampleJSON `shouldSatisfy` (\x -> case x of Success (_ :: Swagger) -> True; _ -> False)
46+ it "roundtrips: fmap toJSON . fromJSON" $ do
47+ (toJSON :: Swagger -> Value) <$> fromJSON petstoreExampleJSON `shouldBe` Success petstoreExampleJSON
55main :: IO ()
49main :: IO ()
56main = hspec spec
50main = hspec spec
@@ -133,34 +127,23 @@ operationExample = mempty
133 & summary ?~ "Updates a pet in the store with form data"
127 & summary ?~ "Updates a pet in the store with form data"
134 & description ?~ ""
128 & description ?~ ""
135 & operationId ?~ "updatePetWithForm"
129 & operationId ?~ "updatePetWithForm"
136− & consumes ?~ MimeList ["application/x-www-form-urlencoded"]
137− & produces ?~ MimeList ["application/json", "application/xml"]
138− & parameters .~ map Inline
130+ & parameters .~ [Inline (mempty
140− & name .~ "petId"
131+ & name .~ "petId"
141− & description ?~ "ID of pet that needs to be updated"
132+ & description ?~ "ID of pet that needs to be updated"
142− & required ?~ True
133+ & required ?~ True
143− & schema .~ ParamOther (stringSchema ParamPath)
134+ & in_ .~ ParamPath
144− , mempty
135+ & schema ?~ Inline (mempty & type_ ?~ SwaggerString))]
145− & name .~ "name"
136+ & requestBody ?~ Inline (
137+ mempty & content . at "application/x-www-form-urlencoded" ?~ (mempty & schema ?~ (Inline (mempty
138+ & properties . at "petId" ?~ Inline (mempty
146− & description ?~ "Updated name of the pet"
139+ & description ?~ "Updated name of the pet"
147− & required ?~ False
140+ & type_ ?~ SwaggerString)
148− & schema .~ ParamOther (stringSchema ParamFormData)
141+ & properties . at "status" ?~ Inline (mempty
151− & description ?~ "Updated status of the pet"
142+ & description ?~ "Updated status of the pet"
152− & required ?~ False
143+ & type_ ?~ SwaggerString)))))
153− & schema .~ ParamOther (stringSchema ParamFormData)
156 & at 200 ?~ "Pet updated."
144 & at 200 ?~ "Pet updated."
157 & at 405 ?~ "Invalid input"
145 & at 405 ?~ "Invalid input"
158 & security .~ [SecurityRequirement [("petstore_auth", ["write:pets", "read:pets"])]]
146 & security .~ [SecurityRequirement [("petstore_auth", ["write:pets", "read:pets"])]]
160− stringSchema :: ParamLocation -> ParamOtherSchema
161− stringSchema loc = mempty
163− & type_ ?~ SwaggerString
165operationExampleJSON :: Value
148operationExampleJSON :: Value
166operationExampleJSON = [aesonQQ|
149operationExampleJSON = [aesonQQ|
@@ -171,36 +154,35 @@ operationExampleJSON = [aesonQQ|
171 "summary": "Updates a pet in the store with form data",
154 "summary": "Updates a pet in the store with form data",
172 "description": "",
155 "description": "",
173 "operationId": "updatePetWithForm",
156 "operationId": "updatePetWithForm",
175− "application/x-www-form-urlencoded"
181 "parameters": [
157 "parameters": [
185− "description": "ID of pet that needs to be updated",
186 "required": true,
159 "required": true,
187− "type": "string"
160+ "schema": {
192− "description": "Updated name of the pet",
194− "type": "string"
161+ "type": "string"
197− "name": "status",
164+ "name": "petId",
198− "in": "formData",
165+ "description": "ID of pet that needs to be updated"
199− "description": "Updated status of the pet",
170+ "application/x-www-form-urlencoded": {
175+ "description": "Updated name of the pet"
179+ "description": "Updated status of the pet"
204 "responses": {
186 "responses": {
206 "description": "Pet updated."
188 "description": "Pet updated."
@@ -251,24 +233,21 @@ schemaSimpleModelExample = mempty
252schemaSimpleModelExampleJSON :: Value
234schemaSimpleModelExampleJSON :: Value
253schemaSimpleModelExampleJSON = [aesonQQ|
235schemaSimpleModelExampleJSON = [aesonQQ|
256− "required": [
236+{ "required": [ "name" ],
259 "properties": {
237 "properties": {
260 "name": {
238 "name": {
261 "type": "string"
239 "type": "string"
263 "address": {
241 "address": {
264− "$ref": "#/definitions/Address"
242+ "$ref": "#/components/schemas/Address"
268 "format": "int32",
245 "format": "int32",
269− "minimum": 0
246+ "minimum": 0,
@@ -401,16 +380,16 @@ paramsDefinitionExample =
401 & name .~ "skip"
380 & name .~ "skip"
402 & description ?~ "number of items to skip"
381 & description ?~ "number of items to skip"
403 & required ?~ True
382 & required ?~ True
404− & schema .~ ParamOther (mempty
405− & in_ .~ ParamQuery
383+ & in_ .~ ParamQuery
384+ & schema ?~ Inline (mempty
406 & type_ ?~ SwaggerInteger
385 & type_ ?~ SwaggerInteger
407 & format ?~ "int32" ))
386 & format ?~ "int32" ))
408 , ("limitParam", mempty
387 , ("limitParam", mempty
409 & name .~ "limit"
388 & name .~ "limit"
410 & description ?~ "max records to return"
389 & description ?~ "max records to return"
411 & required ?~ True
390 & required ?~ True
412− & schema .~ ParamOther (mempty
413− & in_ .~ ParamQuery
391+ & in_ .~ ParamQuery
392+ & schema ?~ Inline (mempty
414 & type_ ?~ SwaggerInteger
393 & type_ ?~ SwaggerInteger
415 & format ?~ "int32" )) ]
394 & format ?~ "int32" )) ]
@@ -422,16 +401,20 @@ paramsDefinitionExampleJSON = [aesonQQ|
422 "in": "query",
401 "in": "query",
423 "description": "number of items to skip",
402 "description": "number of items to skip",
424 "required": true,
403 "required": true,
425− "type": "integer",
405+ "type": "integer",
426− "format": "int32"
406+ "format": "int32"
428 "limitParam": {
409 "limitParam": {
429 "name": "limit",
410 "name": "limit",
430 "in": "query",
411 "in": "query",
431 "description": "max records to return",
412 "description": "max records to return",
432 "required": true,
413 "required": true,
433− "type": "integer",
415+ "type": "integer",
434− "format": "int32"
416+ "format": "int32"
@@ -467,39 +450,45 @@ securityDefinitionsExample = SecurityDefinitions
467 { _securitySchemeType = SecuritySchemeApiKey (ApiKeyParams "api_key" ApiKeyHeader)
450 { _securitySchemeType = SecuritySchemeApiKey (ApiKeyParams "api_key" ApiKeyHeader)
468 , _securitySchemeDescription = Nothing })
451 , _securitySchemeDescription = Nothing })
469 , ("petstore_auth", SecurityScheme
452 , ("petstore_auth", SecurityScheme
470− { _securitySchemeType = SecuritySchemeOAuth2 (OAuth2Params
453+ { _securitySchemeType = SecuritySchemeOAuth2 (mempty & implicit ?~ OAuth2Flow
471− { _oauth2Flow = OAuth2Implicit "http://swagger.io/api/oauth/dialog"
454+ { _oAuth2Params = OAuth2ImplicitFlow "http://swagger.io/api/oauth/dialog"
472− , _oauth2Scopes =
455+ , _oAath2RefreshUrl = Nothing
473− [ ("write:pets", "modify pets in your account")
457+ [ ("write:pets", "modify pets in your account")
474− , ("read:pets", "read your pets") ] } )
458+ , ("read:pets", "read your pets") ] } )
475 , _securitySchemeDescription = Nothing }) ]
459 , _securitySchemeDescription = Nothing }) ]
477securityDefinitionsExampleJSON :: Value
461securityDefinitionsExampleJSON :: Value
478securityDefinitionsExampleJSON = [aesonQQ|
462securityDefinitionsExampleJSON = [aesonQQ|
480 "api_key": {
464 "api_key": {
481− "type": "apiKey",
465+ "in": "header",
482 "name": "api_key",
466 "name": "api_key",
483− "in": "header"
467+ "type": "apiKey"
485 "petstore_auth": {
469 "petstore_auth": {
486 "type": "oauth2",
470 "type": "oauth2",
474+ "write:pets": "modify pets in your account",
475+ "read:pets": "read your pets"
487− "authorizationUrl": "http://swagger.io/api/oauth/dialog",
477+ "authorizationUrl": "http://swagger.io/api/oauth/dialog"
488− "flow": "implicit",
478+ }
490− "write:pets": "modify pets in your account",
491− "read:pets": "read your pets"
497oAuth2SecurityDefinitionsReadExample :: SecurityDefinitions
485oAuth2SecurityDefinitionsReadExample :: SecurityDefinitions
498oAuth2SecurityDefinitionsReadExample = SecurityDefinitions
486oAuth2SecurityDefinitionsReadExample = SecurityDefinitions
499 [ ("petstore_auth", SecurityScheme
487 [ ("petstore_auth", SecurityScheme
500− { _securitySchemeType = SecuritySchemeOAuth2 (OAuth2Params
488+ { _securitySchemeType = SecuritySchemeOAuth2 (mempty & implicit ?~ OAuth2Flow
501− { _oauth2Flow = OAuth2Implicit "http://swagger.io/api/oauth/dialog"
489+ { _oAuth2Params = OAuth2ImplicitFlow "http://swagger.io/api/oauth/dialog"
502− , _oauth2Scopes =
490+ , _oAath2RefreshUrl = Nothing
503 [ ("read:pets", "read your pets") ] } )
492 [ ("read:pets", "read your pets") ] } )
504 , _securitySchemeDescription = Nothing })
493 , _securitySchemeDescription = Nothing })
@@ -507,10 +496,11 @@ oAuth2SecurityDefinitionsReadExample = SecurityDefinitions
507oAuth2SecurityDefinitionsWriteExample :: SecurityDefinitions
496oAuth2SecurityDefinitionsWriteExample :: SecurityDefinitions
508oAuth2SecurityDefinitionsWriteExample = SecurityDefinitions
497oAuth2SecurityDefinitionsWriteExample = SecurityDefinitions
509 [ ("petstore_auth", SecurityScheme
498 [ ("petstore_auth", SecurityScheme
510− { _securitySchemeType = SecuritySchemeOAuth2 (OAuth2Params
499+ { _securitySchemeType = SecuritySchemeOAuth2 (mempty & implicit ?~ OAuth2Flow
511− { _oauth2Flow = OAuth2Implicit "http://swagger.io/api/oauth/dialog"
500+ { _oAuth2Params = OAuth2ImplicitFlow "http://swagger.io/api/oauth/dialog"
512− , _oauth2Scopes =
501+ , _oAath2RefreshUrl = Nothing
513− [ ("write:pets", "modify pets in your account") ] } )
503+ [ ("write:pets", "modify pets in your account") ] } )
514 , _securitySchemeDescription = Nothing })
504 , _securitySchemeDescription = Nothing })
@@ -524,11 +514,14 @@ oAuth2SecurityDefinitionsExampleJSON = [aesonQQ|
525 "petstore_auth": {
515 "petstore_auth": {
526 "type": "oauth2",
516 "type": "oauth2",
520+ "write:pets": "modify pets in your account",
521+ "read:pets": "read your pets"
527− "authorizationUrl": "http://swagger.io/api/oauth/dialog",
523+ "authorizationUrl": "http://swagger.io/api/oauth/dialog"
528− "flow": "implicit",
524+ }
530− "write:pets": "modify pets in your account",
531− "read:pets": "read your pets"
@@ -544,57 +537,54 @@ emptyPathsFieldExample = mempty
544emptyPathsFieldExampleJSON :: Value
537emptyPathsFieldExampleJSON :: Value
545emptyPathsFieldExampleJSON = [aesonQQ|
538emptyPathsFieldExampleJSON = [aesonQQ|
547− "swagger": "2.0",
540+ "openapi": "3.0.0",
548 "info": {"version": "", "title": ""},
541 "info": {"version": "", "title": ""},
549− "paths": {}
542+ "paths": {},
553swaggerExample :: Swagger
547swaggerExample :: Swagger
554swaggerExample = mempty
548swaggerExample = mempty
555− & basePath ?~ "/"
549+ -- & basePath ?~ "/"
556− & schemes ?~ [Http]
550+ -- & schemes ?~ [Http]
557 & info .~ (mempty
551 & info .~ (mempty
558 & version .~ "1.0"
552 & version .~ "1.0"
559 & title .~ "Todo API"
553 & title .~ "Todo API"
560 & license ?~ "MIT"
554 & license ?~ "MIT"
561 & license._Just.url ?~ URL "http://mit.com"
555 & license._Just.url ?~ URL "http://mit.com"
562− & description ?~ "This is a an API that tests servant-swagger support for a Todo API")
556+ & description ?~ "This is an API that tests servant-swagger support for a Todo API")
563 & paths.at "/todo/{id}" ?~ (mempty & get ?~ ((mempty :: Operation)
557 & paths.at "/todo/{id}" ?~ (mempty & get ?~ ((mempty :: Operation)
564− & at 200 ?~ Inline (mempty
558+ & responses . at 200 ?~ Inline (mempty
565 & description .~ "OK"
559 & description .~ "OK"
560+ & content . at "application/json" ?~ (mempty
566− & schema ?~ Inline (mempty
561+ & schema ?~ Inline (mempty
567− & type_ ?~ SwaggerObject
562+ & type_ ?~ SwaggerObject
568− & example ?~ [aesonQQ|
563+ & example ?~ [aesonQQ|
570− "created": 100,
565+ "created": 100,
571− "description": "get milk"
566+ "description": "get milk"
573− & description ?~ "This is some real Todo right here"
568+ & description ?~ "This is some real Todo right here"
574− & properties .~
569+ & properties .~
575− [ ("created", Inline $ mempty
570+ [ ("created", Inline $ mempty
576− & type_ ?~ SwaggerInteger
571+ & type_ ?~ SwaggerInteger
577− & format ?~ "int32")
572+ & format ?~ "int32")
578− , ("description", Inline (mempty & type_ ?~ SwaggerString))]))
573+ , ("description", Inline (mempty & type_ ?~ SwaggerString))])))
579− & produces ?~ MimeList [ "application/json" ]
580 & parameters .~
574 & parameters .~
581 [ Inline $ mempty
575 [ Inline $ mempty
582 & required ?~ True
576 & required ?~ True
583 & name .~ "id"
577 & name .~ "id"
584 & description ?~ "TodoId param"
578 & description ?~ "TodoId param"
585− & schema .~ ParamOther (mempty
580+ & schema ?~ Inline (mempty
587 & type_ ?~ SwaggerString ) ]
581 & type_ ?~ SwaggerString ) ]
588 & tags .~ InsOrdHS.fromList [ "todo" ] ))
582 & tags .~ InsOrdHS.fromList [ "todo" ] ))
590swaggerExampleJSON :: Value
584swaggerExampleJSON :: Value
591swaggerExampleJSON = [aesonQQ|
585swaggerExampleJSON = [aesonQQ|
593− "swagger": "2.0",
587+ "openapi": "3.0.0",
598 "info": {
588 "info": {
599 "version": "1.0",
589 "version": "1.0",
600 "title": "Todo API",
590 "title": "Todo API",
@@ -602,1085 +592,326 @@ swaggerExampleJSON = [aesonQQ|
602 "url": "http://mit.com",
592 "url": "http://mit.com",
603 "name": "MIT"
593 "name": "MIT"
605− "description": "This is a an API that tests servant-swagger support for a Todo API"
595+ "description": "This is an API that tests servant-swagger support for a Todo API"
607 "paths": {
597 "paths": {
608 "/todo/{id}": {
598 "/todo/{id}": {
610− "responses": {
600+ "tags": [
615− "description": "get milk"
618− "description": "This is some real Todo right here",
635 "parameters": [
603 "parameters": [
637 "required": true,
605 "required": true,
638 "in": "path",
609 "in": "path",
639 "name": "id",
610 "name": "id",
641 "description": "TodoId param"
611 "description": "TodoId param"
644− "tags": [
614+ "responses": {
617+ "application/json": {
621+ "description": "get milk"
624+ "description": "This is some real Todo right here",
653petstoreExampleJSON :: Value
647petstoreExampleJSON :: Value
654petstoreExampleJSON = [aesonQQ|
648petstoreExampleJSON = [aesonQQ|
656− "swagger":"2.0",
650+ "openapi": "3.0.0",
657− "info":{
651+ "info": {
658− "description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
659− "version":"1.0.0",
652+ "version": "1.0.0",
660− "title":"Swagger Petstore",
653+ "title": "Swagger Petstore",
661− "termsOfService":"http://swagger.io/terms/",
663− "email":"apiteam@swagger.io"
665− "license":{
654+ "license": {
666− "name":"Apache 2.0",
655+ "name": "MIT"
667− "url":"http://www.apache.org/licenses/LICENSE-2.0.html"
656+ }
670− "host":"petstore.swagger.io",
660+ "url": "http://petstore.swagger.io/v1"
675− "description":"Everything about your Pets",
677− "description":"Find out more",
678− "url":"http://swagger.io"
683− "description":"Access to Petstore orders"
687− "description":"Operations about user",
689− "description":"Find out more about our store",
690− "url":"http://swagger.io"
697− "paths":{
663+ "paths": {
698− "/pet":{
664+ "/pets": {
703− "summary":"Add a new pet to the store",
705− "operationId":"addPet",
718− "description":"Pet object that needs to be added to the store",
721− "$ref":"#/definitions/Pet"
727− "description":"Invalid input"
743− "summary":"Update an existing pet",
745− "operationId":"updatePet",
758− "description":"Pet object that needs to be added to the store",
761− "$ref":"#/definitions/Pet"
767− "description":"Invalid ID supplied"
770− "description":"Pet not found"
773− "description":"Validation exception"
786− "/pet/findByStatus":{
791− "summary":"Finds Pets by status",
792− "description":"Multiple status values can be provided with comma seperated strings",
793− "operationId":"findPetsByStatus",
802− "description":"Status values that need to be considered for filter",
812− "default":"available"
814− "collectionFormat":"csv"
819− "description":"successful operation",
823− "$ref":"#/definitions/Pet"
828− "description":"Invalid status value"
846− "summary":"Finds Pets by tags",
847− "description":"Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
848− "operationId":"findPetsByTags",
857− "description":"Tags to filter by",
863− "collectionFormat":"csv"
868− "description":"successful operation",
872− "$ref":"#/definitions/Pet"
877− "description":"Invalid tag value"
891− "get":{
665+ "get": {
892− "tags":[
666+ "summary": "List all pets",
895− "summary":"Find pet by ID",
896− "description":"Returns a single pet",
897− "operationId":"getPetById",
667+ "operationId": "listPets",
898− "produces":[
668+ "tags": [
899− "application/xml",
669+ "pets"
902− "parameters":[
671+ "parameters": [
904− "name":"petId",
673+ "name": "limit",
905− "in":"path",
674+ "in": "query",
906− "description":"ID of pet to return",
675+ "description": "How many items to return at one time (max 100)",
914− "description":"successful operation",
916− "$ref":"#/definitions/Pet"
920− "description":"Invalid ID supplied"
923− "description":"Pet not found"
936− "summary":"Updates a pet in the store with form data",
938− "operationId":"updatePetWithForm",
940− "application/x-www-form-urlencoded"
950− "description":"ID of pet that needs to be updated",
951− "required":true,
676+ "required": false,
952− "type":"integer",
677+ "schema": {
958− "description":"Updated name of the pet",
965− "description":"Updated status of the pet",
972− "description":"Invalid input"
988− "summary":"Deletes a pet",
990− "operationId":"deletePet",
1005− "description":"Pet id to delete",
1007− "type":"integer",
678+ "type": "integer",
1008− "format":"int64"
679+ "format": "int32"
1013− "description":"Invalid pet value"
1026− "/pet/{petId}/uploadImage":{
1031− "summary":"uploads an image",
1033− "operationId":"uploadFile",
1035− "multipart/form-data"
1044− "description":"ID of pet to update",
1050− "name":"additionalMetadata",
1052− "description":"Additional data to pass to server",
1059− "description":"file to upload",
1066− "description":"successful operation",
1068− "$ref":"#/definitions/ApiResponse"
1082− "/store/inventory":{
1087− "summary":"Returns pet inventories by status",
1088− "description":"Returns a map of status codes to quantities",
1089− "operationId":"getInventory",
1096− "description":"successful operation",
1099− "additionalProperties":{
1118− "summary":"Place an order for a pet",
1120− "operationId":"placeOrder",
1129− "description":"order placed for purchasing the pet",
1132− "$ref":"#/definitions/Order"
1138− "description":"successful operation",
1140− "$ref":"#/definitions/Order"
1144− "description":"Invalid Order"
1149− "/store/order/{orderId}":{
1154− "summary":"Find purchase order by ID",
1155− "description":"For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
1156− "operationId":"getOrderById",
1165− "description":"ID of pet that needs to be fetched",
1175− "description":"successful operation",
1177− "$ref":"#/definitions/Order"
1181− "description":"Invalid ID supplied"
1184− "description":"Order not found"
1192− "summary":"Delete purchase order by ID",
1193− "description":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
1194− "operationId":"deleteOrder",
1203− "description":"ID of the order that needs to be deleted",
1211− "description":"Invalid ID supplied"
1214− "description":"Order not found"
1224− "summary":"Create user",
1225− "description":"This can only be done by the logged in user.",
1226− "operationId":"createUser",
1235− "description":"Created user object",
1238− "$ref":"#/definitions/User"
1244− "description":"successful operation"
1249− "/user/createWithArray":{
683+ "responses": {
1250− "post":{
684+ "200": {
1251− "tags":[
685+ "description": "A paged array of pets",
1252− "user"
686+ "headers": {
1254− "summary":"Creates list of users with given input array",
688+ "description": "A link to the next page of responses",
1255− "description":"",
689+ "schema": {
1256− "operationId":"createUsersWithArrayInput",
690+ "type": "string"
1258− "application/xml",
692+ }
1259− "application/json"
695+ "application/json": {
1261− "parameters":[
697+ "type": "array",
1263− "in":"body",
699+ "type": "object",
1265− "description":"List of user object",
1266− "required":true,
700+ "required": [
1267− "schema":{
701+ "id",
1268− "type":"array",
706+ "type": "integer",
1269− "items":{
707+ "format": "int64"
1270− "$ref":"#/definitions/User"
708+ },
1277− "description":"successful operation"
1282− "/user/createWithList":{
721+ "default": {
1287− "summary":"Creates list of users with given input array",
1288− "description":"",
722+ "description": "unexpected error",
1289− "operationId":"createUsersWithListInput",
723+ "content": {
1292− "application/json"
724+ "application/json": {
1294− "parameters":[
726+ "type": "object",
1298− "description":"List of user object",
1299− "required":true,
727+ "required": [
1300− "schema":{
728+ "code",
1301− "type":"array",
733+ "type": "integer",
1302− "items":{
734+ "format": "int32"
1303− "$ref":"#/definitions/User"
735+ },
1310− "description":"successful operation"
1315− "/user/login":{
746+ "post": {
1316− "get":{
747+ "summary": "Create a pet",
1320− "summary":"Logs user into the system",
1322− "operationId":"loginUser",
748+ "operationId": "createPets",
1323− "produces":[
749+ "tags": [
1324− "application/xml",
750+ "pets"
754+ "description": "Null response"
757+ "description": "unexpected error",
1325− "application/json"
759+ "application/json": {
1331− "description":"The user name for login",
1338− "description":"The password for login in clear text",
1345− "description":"successful operation",
1346− "schema":{
760+ "schema": {
1347− "type":"string"
761+ "type": "object",
1348− },
762+ "required": [
1349− "headers":{
763+ "code",
1350− "X-Rate-Limit":{
764+ "message"
1351− "type":"integer",
768+ "type": "integer",
1352− "format":"int32",
769+ "format": "int32"
1353− "description":"calls per hour allowed by the user"
1355− "X-Expires-After":{
771+ "message": {
1356− "type":"string",
772+ "type": "string"
1357− "format":"date-time",
1358− "description":"date in UTC when toekn expires"
1363− "description":"Invalid username/password supplied"
1368− "/user/logout":{
781+ },
1369− "get":{
783+ "get": {
1370− "tags":[
784+ "summary": "Info for a specific pet",
1373− "summary":"Logs out current logged in user session",
1375− "operationId":"logoutUser",
785+ "operationId": "showPetById",
1376− "produces":[
786+ "tags": [
1377− "application/xml",
787+ "pets"
1380− "parameters": [],
789+ "parameters": [
1381− "responses":{
790+ {
1382− "default":{
791+ "name": "petId",
1383− "description":"successful operation"
792+ "in": "path",
1384− }
793+ "required": true,
794+ "description": "The id of the pet to retrieve",
1388− "/user/{username}":{
1393− "summary":"Get user by user name",
1395− "operationId":"getUserByName",
1404− "description":"The name that needs to be fetched. Use user1 for testing. ",
1409− "responses":{
800+ "responses": {
1410− "200":{
801+ "200": {
1411− "description":"successful operation",
802+ "description": "Expected response to a valid request",
804+ "application/json": {
1412− "schema":{
805+ "schema": {
1413− "$ref":"#/definitions/User"
806+ "type": "object",
1417− "description":"Invalid username supplied"
1420− "description":"User not found"
1424− "put":{
827+ "default": {
1425− "tags":[
828+ "description": "unexpected error",
1426− "user"
829+ "content": {
1428− "summary":"Updated user",
1429− "description":"This can only be done by the logged in user.",
1430− "operationId":"updateUser",
1433− "application/json"
830+ "application/json": {
1435− "parameters":[
832+ "type": "object",
1436− {
833+ "required": [
1437− "name":"username",
834+ "code",
1438− "in":"path",
835+ "message"
1439− "description":"name that need to be deleted",
836+ ],
1440− "required":true,
837+ "properties": {
1441− "type":"string"
843+ "type": "string"
1446− "description":"Updated user object",
1449− "$ref":"#/definitions/User"
1455− "description":"Invalid user supplied"
1458− "description":"User not found"
1466− "summary":"Delete user",
1467− "description":"This can only be done by the logged in user.",
1468− "operationId":"deleteUser",
1477− "description":"The name that needs to be deleted",
1484− "description":"Invalid username supplied"
1487− "description":"User not found"
1493− "securityDefinitions":{
1496− "authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog",
1499− "write:pets":"modify pets in your account",
1500− "read:pets":"read your pets"
1521− "quantity":{
854+ "components": {
1522− "type":"integer",
855+ "schemas": {
1523− "format":"int32"
856+ "Pet": {
1527− "format":"date-time"
1530− "type":"string",
857+ "type": "object",
1531− "description":"Order Status",
858+ "required": [
1533− "placed",
860+ "name"
1549− "properties":{
862+ "properties": {
1551− "type":"integer",
864+ "type": "integer",
1552− "format":"int64"
865+ "format": "int64"
1554− "name":{
867+ "name": {
1573− "type":"string"
868+ "type": "string"
1575− "lastName":{
870+ "tag": {
1590− "description":"User Status"
1605− "type":"string"
871+ "type": "string"
1612− "Pet":{
875+ "Pets": {
1613− "type":"object",
878+ "type": "object",
1614− "required":[
879+ "required": [
1616− "photoUrls"
881+ "name"
1618− "properties":{
883+ "properties": {
1620− "type":"integer",
885+ "type": "integer",
1621− "format":"int64"
886+ "format": "int64"
1624− "$ref":"#/definitions/Category"
1633− "name":"photoUrl",
888+ "name": {
1637− "type":"string"
889+ "type": "string"
1643− "name":"tag",
891+ "tag": {
1647− "$ref":"#/definitions/Tag"
1651− "type":"string",
892+ "type": "string"
1652− "description":"pet status in the store",
1664− "ApiResponse":{
897+ "Error": {
1665− "type":"object",
898+ "type": "object",
1666− "properties":{
903+ "properties": {
1667− "code":{
904+ "code": {
1668− "type":"integer",
905+ "type": "integer",
1669− "format":"int32"
906+ "format": "int32"
1671− "type":{
908+ "message": {
1675− "type":"string"
909+ "type": "string"
1681− "description":"Find out more about Swagger",
1682− "url":"http://swagger.io"
@@ -1702,7 +933,7 @@ compositionSchemaExampleJSON = [aesonQQ|
1702 "type": "object",
933 "type": "object",
1703 "allOf": [
934 "allOf": [
1705− "$ref": "#/definitions/Other"
936+ "$ref": "#/components/schemas/Other"
1708 "type": "object",
939 "type": "object",