git.iko.soy/typeable/swagger2
on master help sign in
Add petstore swagger.json decoding test
commitdd0defb6e85abe7069b0cd868683ce2c637fc91f authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateTue 10 Nov 2015, 01:17 (11 years ago) parent81ccb6e
1 file changed+1048−1
test/Data/SwaggerSpec.hs+1048−1
test/Data/SwaggerSpec.hs+1048−1
@@ -1,5 +1,6 @@
11{-# LANGUAGE OverloadedLists #-}
22{-# LANGUAGE OverloadedStrings #-}
3+{-# LANGUAGE ScopedTypeVariables #-}
34{-# LANGUAGE QuasiQuotes #-}
45module Data.SwaggerSpec where
56
@@ -54,7 +55,11 @@ spec = do
5455 describe "Parameters Definition Object" $ parametersDefinitionExample <~> parametersDefinitionExampleJSON
5556 describe "Responses Definition Object" $ responsesDefinitionExample <~> responsesDefinitionExampleJSON
5657 describe "Security Definitions Object" $ securityDefinitionsExample <~> securityDefinitionsExampleJSON
57− describe "Swagger Object" $ swaggerExample <~> swaggerExampleJSON
58+ describe "Swagger Object" $ do
59+ context "Todo Example" $ swaggerExample <~> swaggerExampleJSON
60+ context "PetStore Example" $
61+ it "decodes successfully" $ do
62+ fromJSON petstoreExampleJSON `shouldSatisfy` (\x -> case x of Success (_ :: Swagger) -> True; _ -> False)
5863
5964main :: IO ()
6065main = hspec spec
@@ -614,3 +619,1045 @@ swaggerExampleJSON = [aesonQQ|
614619 }
615620}
616621|]
622+
623+petstoreExampleJSON :: Value
624+petstoreExampleJSON = [aesonQQ|
625+{
626+ "swagger":"2.0",
627+ "info":{
628+ "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.",
629+ "version":"1.0.0",
630+ "title":"Swagger Petstore",
631+ "termsOfService":"http://swagger.io/terms/",
632+ "contact":{
633+ "email":"apiteam@swagger.io"
634+ },
635+ "license":{
636+ "name":"Apache 2.0",
637+ "url":"http://www.apache.org/licenses/LICENSE-2.0.html"
638+ }
639+ },
640+ "host":"petstore.swagger.io",
641+ "basePath":"/v2",
642+ "tags":[
643+ {
644+ "name":"pet",
645+ "description":"Everything about your Pets",
646+ "externalDocs":{
647+ "description":"Find out more",
648+ "url":"http://swagger.io"
649+ }
650+ },
651+ {
652+ "name":"store",
653+ "description":"Access to Petstore orders"
654+ },
655+ {
656+ "name":"user",
657+ "description":"Operations about user",
658+ "externalDocs":{
659+ "description":"Find out more about our store",
660+ "url":"http://swagger.io"
661+ }
662+ }
663+ ],
664+ "schemes":[
665+ "http"
666+ ],
667+ "paths":{
668+ "/pet":{
669+ "post":{
670+ "tags":[
671+ "pet"
672+ ],
673+ "summary":"Add a new pet to the store",
674+ "description":"",
675+ "operationId":"addPet",
676+ "consumes":[
677+ "application/json",
678+ "application/xml"
679+ ],
680+ "produces":[
681+ "application/xml",
682+ "application/json"
683+ ],
684+ "parameters":[
685+ {
686+ "in":"body",
687+ "name":"body",
688+ "description":"Pet object that needs to be added to the store",
689+ "required":true,
690+ "schema":{
691+ "$ref":"#/definitions/Pet"
692+ }
693+ }
694+ ],
695+ "responses":{
696+ "405":{
697+ "description":"Invalid input"
698+ }
699+ },
700+ "security":[
701+ {
702+ "petstore_auth":[
703+ "write:pets",
704+ "read:pets"
705+ ]
706+ }
707+ ]
708+ },
709+ "put":{
710+ "tags":[
711+ "pet"
712+ ],
713+ "summary":"Update an existing pet",
714+ "description":"",
715+ "operationId":"updatePet",
716+ "consumes":[
717+ "application/json",
718+ "application/xml"
719+ ],
720+ "produces":[
721+ "application/xml",
722+ "application/json"
723+ ],
724+ "parameters":[
725+ {
726+ "in":"body",
727+ "name":"body",
728+ "description":"Pet object that needs to be added to the store",
729+ "required":true,
730+ "schema":{
731+ "$ref":"#/definitions/Pet"
732+ }
733+ }
734+ ],
735+ "responses":{
736+ "400":{
737+ "description":"Invalid ID supplied"
738+ },
739+ "404":{
740+ "description":"Pet not found"
741+ },
742+ "405":{
743+ "description":"Validation exception"
744+ }
745+ },
746+ "security":[
747+ {
748+ "petstore_auth":[
749+ "write:pets",
750+ "read:pets"
751+ ]
752+ }
753+ ]
754+ }
755+ },
756+ "/pet/findByStatus":{
757+ "get":{
758+ "tags":[
759+ "pet"
760+ ],
761+ "summary":"Finds Pets by status",
762+ "description":"Multiple status values can be provided with comma seperated strings",
763+ "operationId":"findPetsByStatus",
764+ "produces":[
765+ "application/xml",
766+ "application/json"
767+ ],
768+ "parameters":[
769+ {
770+ "name":"status",
771+ "in":"query",
772+ "description":"Status values that need to be considered for filter",
773+ "required":true,
774+ "type":"array",
775+ "items":{
776+ "type":"string",
777+ "enum":[
778+ "available",
779+ "pending",
780+ "sold"
781+ ],
782+ "default":"available"
783+ },
784+ "collectionFormat":"csv"
785+ }
786+ ],
787+ "responses":{
788+ "200":{
789+ "description":"successful operation",
790+ "schema":{
791+ "type":"array",
792+ "items":{
793+ "$ref":"#/definitions/Pet"
794+ }
795+ }
796+ },
797+ "400":{
798+ "description":"Invalid status value"
799+ }
800+ },
801+ "security":[
802+ {
803+ "petstore_auth":[
804+ "write:pets",
805+ "read:pets"
806+ ]
807+ }
808+ ]
809+ }
810+ },
811+ "/pet/findByTags":{
812+ "get":{
813+ "tags":[
814+ "pet"
815+ ],
816+ "summary":"Finds Pets by tags",
817+ "description":"Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
818+ "operationId":"findPetsByTags",
819+ "produces":[
820+ "application/xml",
821+ "application/json"
822+ ],
823+ "parameters":[
824+ {
825+ "name":"tags",
826+ "in":"query",
827+ "description":"Tags to filter by",
828+ "required":true,
829+ "type":"array",
830+ "items":{
831+ "type":"string"
832+ },
833+ "collectionFormat":"csv"
834+ }
835+ ],
836+ "responses":{
837+ "200":{
838+ "description":"successful operation",
839+ "schema":{
840+ "type":"array",
841+ "items":{
842+ "$ref":"#/definitions/Pet"
843+ }
844+ }
845+ },
846+ "400":{
847+ "description":"Invalid tag value"
848+ }
849+ },
850+ "security":[
851+ {
852+ "petstore_auth":[
853+ "write:pets",
854+ "read:pets"
855+ ]
856+ }
857+ ]
858+ }
859+ },
860+ "/pet/{petId}":{
861+ "get":{
862+ "tags":[
863+ "pet"
864+ ],
865+ "summary":"Find pet by ID",
866+ "description":"Returns a single pet",
867+ "operationId":"getPetById",
868+ "produces":[
869+ "application/xml",
870+ "application/json"
871+ ],
872+ "parameters":[
873+ {
874+ "name":"petId",
875+ "in":"path",
876+ "description":"ID of pet to return",
877+ "required":true,
878+ "type":"integer",
879+ "format":"int64"
880+ }
881+ ],
882+ "responses":{
883+ "200":{
884+ "description":"successful operation",
885+ "schema":{
886+ "$ref":"#/definitions/Pet"
887+ }
888+ },
889+ "400":{
890+ "description":"Invalid ID supplied"
891+ },
892+ "404":{
893+ "description":"Pet not found"
894+ }
895+ },
896+ "security":[
897+ {
898+ "api_key":[
899+
900+ ]
901+ }
902+ ]
903+ },
904+ "post":{
905+ "tags":[
906+ "pet"
907+ ],
908+ "summary":"Updates a pet in the store with form data",
909+ "description":"",
910+ "operationId":"updatePetWithForm",
911+ "consumes":[
912+ "application/x-www-form-urlencoded"
913+ ],
914+ "produces":[
915+ "application/xml",
916+ "application/json"
917+ ],
918+ "parameters":[
919+ {
920+ "name":"petId",
921+ "in":"path",
922+ "description":"ID of pet that needs to be updated",
923+ "required":true,
924+ "type":"integer",
925+ "format":"int64"
926+ },
927+ {
928+ "name":"name",
929+ "in":"formData",
930+ "description":"Updated name of the pet",
931+ "required":false,
932+ "type":"string"
933+ },
934+ {
935+ "name":"status",
936+ "in":"formData",
937+ "description":"Updated status of the pet",
938+ "required":false,
939+ "type":"string"
940+ }
941+ ],
942+ "responses":{
943+ "405":{
944+ "description":"Invalid input"
945+ }
946+ },
947+ "security":[
948+ {
949+ "petstore_auth":[
950+ "write:pets",
951+ "read:pets"
952+ ]
953+ }
954+ ]
955+ },
956+ "delete":{
957+ "tags":[
958+ "pet"
959+ ],
960+ "summary":"Deletes a pet",
961+ "description":"",
962+ "operationId":"deletePet",
963+ "produces":[
964+ "application/xml",
965+ "application/json"
966+ ],
967+ "parameters":[
968+ {
969+ "name":"api_key",
970+ "in":"header",
971+ "required":false,
972+ "type":"string"
973+ },
974+ {
975+ "name":"petId",
976+ "in":"path",
977+ "description":"Pet id to delete",
978+ "required":true,
979+ "type":"integer",
980+ "format":"int64"
981+ }
982+ ],
983+ "responses":{
984+ "400":{
985+ "description":"Invalid pet value"
986+ }
987+ },
988+ "security":[
989+ {
990+ "petstore_auth":[
991+ "write:pets",
992+ "read:pets"
993+ ]
994+ }
995+ ]
996+ }
997+ },
998+ "/pet/{petId}/uploadImage":{
999+ "post":{
1000+ "tags":[
1001+ "pet"
1002+ ],
1003+ "summary":"uploads an image",
1004+ "description":"",
1005+ "operationId":"uploadFile",
1006+ "consumes":[
1007+ "multipart/form-data"
1008+ ],
1009+ "produces":[
1010+ "application/json"
1011+ ],
1012+ "parameters":[
1013+ {
1014+ "name":"petId",
1015+ "in":"path",
1016+ "description":"ID of pet to update",
1017+ "required":true,
1018+ "type":"integer",
1019+ "format":"int64"
1020+ },
1021+ {
1022+ "name":"additionalMetadata",
1023+ "in":"formData",
1024+ "description":"Additional data to pass to server",
1025+ "required":false,
1026+ "type":"string"
1027+ },
1028+ {
1029+ "name":"file",
1030+ "in":"formData",
1031+ "description":"file to upload",
1032+ "required":false,
1033+ "type":"file"
1034+ }
1035+ ],
1036+ "responses":{
1037+ "200":{
1038+ "description":"successful operation",
1039+ "schema":{
1040+ "$ref":"#/definitions/ApiResponse"
1041+ }
1042+ }
1043+ },
1044+ "security":[
1045+ {
1046+ "petstore_auth":[
1047+ "write:pets",
1048+ "read:pets"
1049+ ]
1050+ }
1051+ ]
1052+ }
1053+ },
1054+ "/store/inventory":{
1055+ "get":{
1056+ "tags":[
1057+ "store"
1058+ ],
1059+ "summary":"Returns pet inventories by status",
1060+ "description":"Returns a map of status codes to quantities",
1061+ "operationId":"getInventory",
1062+ "produces":[
1063+ "application/json"
1064+ ],
1065+ "parameters":[
1066+
1067+ ],
1068+ "responses":{
1069+ "200":{
1070+ "description":"successful operation",
1071+ "schema":{
1072+ "type":"object",
1073+ "additionalProperties":{
1074+ "type":"integer",
1075+ "format":"int32"
1076+ }
1077+ }
1078+ }
1079+ },
1080+ "security":[
1081+ {
1082+ "api_key":[
1083+
1084+ ]
1085+ }
1086+ ]
1087+ }
1088+ },
1089+ "/store/order":{
1090+ "post":{
1091+ "tags":[
1092+ "store"
1093+ ],
1094+ "summary":"Place an order for a pet",
1095+ "description":"",
1096+ "operationId":"placeOrder",
1097+ "produces":[
1098+ "application/xml",
1099+ "application/json"
1100+ ],
1101+ "parameters":[
1102+ {
1103+ "in":"body",
1104+ "name":"body",
1105+ "description":"order placed for purchasing the pet",
1106+ "required":true,
1107+ "schema":{
1108+ "$ref":"#/definitions/Order"
1109+ }
1110+ }
1111+ ],
1112+ "responses":{
1113+ "200":{
1114+ "description":"successful operation",
1115+ "schema":{
1116+ "$ref":"#/definitions/Order"
1117+ }
1118+ },
1119+ "400":{
1120+ "description":"Invalid Order"
1121+ }
1122+ }
1123+ }
1124+ },
1125+ "/store/order/{orderId}":{
1126+ "get":{
1127+ "tags":[
1128+ "store"
1129+ ],
1130+ "summary":"Find purchase order by ID",
1131+ "description":"For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
1132+ "operationId":"getOrderById",
1133+ "produces":[
1134+ "application/xml",
1135+ "application/json"
1136+ ],
1137+ "parameters":[
1138+ {
1139+ "name":"orderId",
1140+ "in":"path",
1141+ "description":"ID of pet that needs to be fetched",
1142+ "required":true,
1143+ "type":"integer",
1144+ "maximum":5.0,
1145+ "minimum":1.0,
1146+ "format":"int64"
1147+ }
1148+ ],
1149+ "responses":{
1150+ "200":{
1151+ "description":"successful operation",
1152+ "schema":{
1153+ "$ref":"#/definitions/Order"
1154+ }
1155+ },
1156+ "400":{
1157+ "description":"Invalid ID supplied"
1158+ },
1159+ "404":{
1160+ "description":"Order not found"
1161+ }
1162+ }
1163+ },
1164+ "delete":{
1165+ "tags":[
1166+ "store"
1167+ ],
1168+ "summary":"Delete purchase order by ID",
1169+ "description":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
1170+ "operationId":"deleteOrder",
1171+ "produces":[
1172+ "application/xml",
1173+ "application/json"
1174+ ],
1175+ "parameters":[
1176+ {
1177+ "name":"orderId",
1178+ "in":"path",
1179+ "description":"ID of the order that needs to be deleted",
1180+ "required":true,
1181+ "type":"string",
1182+ "minimum":1.0
1183+ }
1184+ ],
1185+ "responses":{
1186+ "400":{
1187+ "description":"Invalid ID supplied"
1188+ },
1189+ "404":{
1190+ "description":"Order not found"
1191+ }
1192+ }
1193+ }
1194+ },
1195+ "/user":{
1196+ "post":{
1197+ "tags":[
1198+ "user"
1199+ ],
1200+ "summary":"Create user",
1201+ "description":"This can only be done by the logged in user.",
1202+ "operationId":"createUser",
1203+ "produces":[
1204+ "application/xml",
1205+ "application/json"
1206+ ],
1207+ "parameters":[
1208+ {
1209+ "in":"body",
1210+ "name":"body",
1211+ "description":"Created user object",
1212+ "required":true,
1213+ "schema":{
1214+ "$ref":"#/definitions/User"
1215+ }
1216+ }
1217+ ],
1218+ "responses":{
1219+ "default":{
1220+ "description":"successful operation"
1221+ }
1222+ }
1223+ }
1224+ },
1225+ "/user/createWithArray":{
1226+ "post":{
1227+ "tags":[
1228+ "user"
1229+ ],
1230+ "summary":"Creates list of users with given input array",
1231+ "description":"",
1232+ "operationId":"createUsersWithArrayInput",
1233+ "produces":[
1234+ "application/xml",
1235+ "application/json"
1236+ ],
1237+ "parameters":[
1238+ {
1239+ "in":"body",
1240+ "name":"body",
1241+ "description":"List of user object",
1242+ "required":true,
1243+ "schema":{
1244+ "type":"array",
1245+ "items":{
1246+ "$ref":"#/definitions/User"
1247+ }
1248+ }
1249+ }
1250+ ],
1251+ "responses":{
1252+ "default":{
1253+ "description":"successful operation"
1254+ }
1255+ }
1256+ }
1257+ },
1258+ "/user/createWithList":{
1259+ "post":{
1260+ "tags":[
1261+ "user"
1262+ ],
1263+ "summary":"Creates list of users with given input array",
1264+ "description":"",
1265+ "operationId":"createUsersWithListInput",
1266+ "produces":[
1267+ "application/xml",
1268+ "application/json"
1269+ ],
1270+ "parameters":[
1271+ {
1272+ "in":"body",
1273+ "name":"body",
1274+ "description":"List of user object",
1275+ "required":true,
1276+ "schema":{
1277+ "type":"array",
1278+ "items":{
1279+ "$ref":"#/definitions/User"
1280+ }
1281+ }
1282+ }
1283+ ],
1284+ "responses":{
1285+ "default":{
1286+ "description":"successful operation"
1287+ }
1288+ }
1289+ }
1290+ },
1291+ "/user/login":{
1292+ "get":{
1293+ "tags":[
1294+ "user"
1295+ ],
1296+ "summary":"Logs user into the system",
1297+ "description":"",
1298+ "operationId":"loginUser",
1299+ "produces":[
1300+ "application/xml",
1301+ "application/json"
1302+ ],
1303+ "parameters":[
1304+ {
1305+ "name":"username",
1306+ "in":"query",
1307+ "description":"The user name for login",
1308+ "required":true,
1309+ "type":"string"
1310+ },
1311+ {
1312+ "name":"password",
1313+ "in":"query",
1314+ "description":"The password for login in clear text",
1315+ "required":true,
1316+ "type":"string"
1317+ }
1318+ ],
1319+ "responses":{
1320+ "200":{
1321+ "description":"successful operation",
1322+ "schema":{
1323+ "type":"string"
1324+ },
1325+ "headers":{
1326+ "X-Rate-Limit":{
1327+ "type":"integer",
1328+ "format":"int32",
1329+ "description":"calls per hour allowed by the user"
1330+ },
1331+ "X-Expires-After":{
1332+ "type":"string",
1333+ "format":"date-time",
1334+ "description":"date in UTC when toekn expires"
1335+ }
1336+ }
1337+ },
1338+ "400":{
1339+ "description":"Invalid username/password supplied"
1340+ }
1341+ }
1342+ }
1343+ },
1344+ "/user/logout":{
1345+ "get":{
1346+ "tags":[
1347+ "user"
1348+ ],
1349+ "summary":"Logs out current logged in user session",
1350+ "description":"",
1351+ "operationId":"logoutUser",
1352+ "produces":[
1353+ "application/xml",
1354+ "application/json"
1355+ ],
1356+ "parameters":[
1357+
1358+ ],
1359+ "responses":{
1360+ "default":{
1361+ "description":"successful operation"
1362+ }
1363+ }
1364+ }
1365+ },
1366+ "/user/{username}":{
1367+ "get":{
1368+ "tags":[
1369+ "user"
1370+ ],
1371+ "summary":"Get user by user name",
1372+ "description":"",
1373+ "operationId":"getUserByName",
1374+ "produces":[
1375+ "application/xml",
1376+ "application/json"
1377+ ],
1378+ "parameters":[
1379+ {
1380+ "name":"username",
1381+ "in":"path",
1382+ "description":"The name that needs to be fetched. Use user1 for testing. ",
1383+ "required":true,
1384+ "type":"string"
1385+ }
1386+ ],
1387+ "responses":{
1388+ "200":{
1389+ "description":"successful operation",
1390+ "schema":{
1391+ "$ref":"#/definitions/User"
1392+ }
1393+ },
1394+ "400":{
1395+ "description":"Invalid username supplied"
1396+ },
1397+ "404":{
1398+ "description":"User not found"
1399+ }
1400+ }
1401+ },
1402+ "put":{
1403+ "tags":[
1404+ "user"
1405+ ],
1406+ "summary":"Updated user",
1407+ "description":"This can only be done by the logged in user.",
1408+ "operationId":"updateUser",
1409+ "produces":[
1410+ "application/xml",
1411+ "application/json"
1412+ ],
1413+ "parameters":[
1414+ {
1415+ "name":"username",
1416+ "in":"path",
1417+ "description":"name that need to be deleted",
1418+ "required":true,
1419+ "type":"string"
1420+ },
1421+ {
1422+ "in":"body",
1423+ "name":"body",
1424+ "description":"Updated user object",
1425+ "required":true,
1426+ "schema":{
1427+ "$ref":"#/definitions/User"
1428+ }
1429+ }
1430+ ],
1431+ "responses":{
1432+ "400":{
1433+ "description":"Invalid user supplied"
1434+ },
1435+ "404":{
1436+ "description":"User not found"
1437+ }
1438+ }
1439+ },
1440+ "delete":{
1441+ "tags":[
1442+ "user"
1443+ ],
1444+ "summary":"Delete user",
1445+ "description":"This can only be done by the logged in user.",
1446+ "operationId":"deleteUser",
1447+ "produces":[
1448+ "application/xml",
1449+ "application/json"
1450+ ],
1451+ "parameters":[
1452+ {
1453+ "name":"username",
1454+ "in":"path",
1455+ "description":"The name that needs to be deleted",
1456+ "required":true,
1457+ "type":"string"
1458+ }
1459+ ],
1460+ "responses":{
1461+ "400":{
1462+ "description":"Invalid username supplied"
1463+ },
1464+ "404":{
1465+ "description":"User not found"
1466+ }
1467+ }
1468+ }
1469+ }
1470+ },
1471+ "securityDefinitions":{
1472+ "petstore_auth":{
1473+ "type":"oauth2",
1474+ "authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog",
1475+ "flow":"implicit",
1476+ "scopes":{
1477+ "write:pets":"modify pets in your account",
1478+ "read:pets":"read your pets"
1479+ }
1480+ },
1481+ "api_key":{
1482+ "type":"apiKey",
1483+ "name":"api_key",
1484+ "in":"header"
1485+ }
1486+ },
1487+ "definitions":{
1488+ "Order":{
1489+ "type":"object",
1490+ "properties":{
1491+ "id":{
1492+ "type":"integer",
1493+ "format":"int64"
1494+ },
1495+ "petId":{
1496+ "type":"integer",
1497+ "format":"int64"
1498+ },
1499+ "quantity":{
1500+ "type":"integer",
1501+ "format":"int32"
1502+ },
1503+ "shipDate":{
1504+ "type":"string",
1505+ "format":"date-time"
1506+ },
1507+ "status":{
1508+ "type":"string",
1509+ "description":"Order Status",
1510+ "enum":[
1511+ "placed",
1512+ "approved",
1513+ "delivered"
1514+ ]
1515+ },
1516+ "complete":{
1517+ "type":"boolean",
1518+ "default":false
1519+ }
1520+ },
1521+ "xml":{
1522+ "name":"Order"
1523+ }
1524+ },
1525+ "Category":{
1526+ "type":"object",
1527+ "properties":{
1528+ "id":{
1529+ "type":"integer",
1530+ "format":"int64"
1531+ },
1532+ "name":{
1533+ "type":"string"
1534+ }
1535+ },
1536+ "xml":{
1537+ "name":"Category"
1538+ }
1539+ },
1540+ "User":{
1541+ "type":"object",
1542+ "properties":{
1543+ "id":{
1544+ "type":"integer",
1545+ "format":"int64"
1546+ },
1547+ "username":{
1548+ "type":"string"
1549+ },
1550+ "firstName":{
1551+ "type":"string"
1552+ },
1553+ "lastName":{
1554+ "type":"string"
1555+ },
1556+ "email":{
1557+ "type":"string"
1558+ },
1559+ "password":{
1560+ "type":"string"
1561+ },
1562+ "phone":{
1563+ "type":"string"
1564+ },
1565+ "userStatus":{
1566+ "type":"integer",
1567+ "format":"int32",
1568+ "description":"User Status"
1569+ }
1570+ },
1571+ "xml":{
1572+ "name":"User"
1573+ }
1574+ },
1575+ "Tag":{
1576+ "type":"object",
1577+ "properties":{
1578+ "id":{
1579+ "type":"integer",
1580+ "format":"int64"
1581+ },
1582+ "name":{
1583+ "type":"string"
1584+ }
1585+ },
1586+ "xml":{
1587+ "name":"Tag"
1588+ }
1589+ },
1590+ "Pet":{
1591+ "type":"object",
1592+ "required":[
1593+ "name",
1594+ "photoUrls"
1595+ ],
1596+ "properties":{
1597+ "id":{
1598+ "type":"integer",
1599+ "format":"int64"
1600+ },
1601+ "category":{
1602+ "$ref":"#/definitions/Category"
1603+ },
1604+ "name":{
1605+ "type":"string",
1606+ "example":"doggie"
1607+ },
1608+ "photoUrls":{
1609+ "type":"array",
1610+ "xml":{
1611+ "name":"photoUrl",
1612+ "wrapped":true
1613+ },
1614+ "items":{
1615+ "type":"string"
1616+ }
1617+ },
1618+ "tags":{
1619+ "type":"array",
1620+ "xml":{
1621+ "name":"tag",
1622+ "wrapped":true
1623+ },
1624+ "items":{
1625+ "$ref":"#/definitions/Tag"
1626+ }
1627+ },
1628+ "status":{
1629+ "type":"string",
1630+ "description":"pet status in the store",
1631+ "enum":[
1632+ "available",
1633+ "pending",
1634+ "sold"
1635+ ]
1636+ }
1637+ },
1638+ "xml":{
1639+ "name":"Pet"
1640+ }
1641+ },
1642+ "ApiResponse":{
1643+ "type":"object",
1644+ "properties":{
1645+ "code":{
1646+ "type":"integer",
1647+ "format":"int32"
1648+ },
1649+ "type":{
1650+ "type":"string"
1651+ },
1652+ "message":{
1653+ "type":"string"
1654+ }
1655+ }
1656+ }
1657+ },
1658+ "externalDocs":{
1659+ "description":"Find out more about Swagger",
1660+ "url":"http://swagger.io"
1661+ }
1662+}
1663+|]