From a3c6d3af5e1f3f40cff97f32b2ae253a4df02e57 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 17 Apr 2016 03:25:12 +0800 Subject: [PATCH] restore petstore.json from petstore.yaml --- .../src/test/resources/2_0/petstore.json | 499 +----------------- 1 file changed, 18 insertions(+), 481 deletions(-) diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json index 7f707ce315ed..cf00cad21d65 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.json @@ -4,9 +4,9 @@ "description": "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters", "version": "1.0.0", "title": "Swagger Petstore", - "termsOfService": "http://swagger.io/terms/", + "termsOfService": "http://helloreverb.com/terms/", "contact": { - "email": "apiteam@swagger.io" + "email": "apiteam@wordnik.com" }, "license": { "name": "Apache 2.0", @@ -19,49 +19,6 @@ "http" ], "paths": { - "/pet?testing_byte_array=true": { - "post": { - "tags": [ - "pet" - ], - "summary": "Fake endpoint to test byte array in body parameter for adding a new pet to the store", - "description": "", - "operationId": "addPetUsingByteArray", - "consumes": [ - "application/json", - "application/xml" - ], - "produces": [ - "application/json", - "application/xml" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "Pet object in the form of byte array", - "required": false, - "schema": { - "type": "string", - "format": "binary" - } - } - ], - "responses": { - "405": { - "description": "Invalid input" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, "/pet": { "post": { "tags": [ @@ -156,7 +113,7 @@ "pet" ], "summary": "Finds Pets by status", - "description": "Multiple status values can be provided with comma separated strings", + "description": "Multiple status values can be provided with comma seperated strings", "operationId": "findPetsByStatus", "produces": [ "application/json", @@ -166,23 +123,13 @@ { "name": "status", "in": "query", - "description": "Status values that need to be considered for query", + "description": "Status values that need to be considered for filter", "required": false, "type": "array", "items": { - "type": "string", - "enum": [ - "available", - "pending", - "sold" - ] + "type": "string" }, "collectionFormat": "multi", - "enum": [ - "available", - "pending", - "sold" - ], "default": "available" } ], @@ -194,6 +141,15 @@ "items": { "$ref": "#/definitions/Pet" } + }, + "examples": { + "application/json": { + "name": "Puma", + "type": "Dog", + "color": "Black", + "gender": "Female", + "breed": "Mixed" + } } }, "400": { @@ -259,150 +215,6 @@ ] } }, - "/pet/{petId}?testing_byte_array=true": { - "get": { - "tags": [ - "pet" - ], - "summary": "Fake endpoint to test byte array return by 'Find pet by ID'", - "description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", - "operationId": "", - "produces": [ - "application/json", - "application/xml" - ], - "parameters": [ - { - "name": "petId", - "in": "path", - "description": "ID of pet that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "404": { - "description": "Pet not found" - }, - "200": { - "description": "successful operation", - "schema": { - "type": "string", - "format": "binary" - } - }, - "400": { - "description": "Invalid ID supplied" - } - }, - "security": [ - { - "api_key": [] - }, - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, - "/pet/{petId}?response=inline_arbitrary_object": { - "get": { - "tags": [ - "pet" - ], - "summary": "Fake endpoint to test inline arbitrary object return by 'Find pet by ID'", - "description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", - "operationId": "getPetByIdInObject", - "produces": [ - "application/json", - "application/xml" - ], - "parameters": [ - { - "name": "petId", - "in": "path", - "description": "ID of pet that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "404": { - "description": "Pet not found" - }, - "200": { - "description": "successful operation", - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "category": { - "type": "object" - }, - "name": { - "type": "string", - "example": "doggie" - }, - "photoUrls": { - "type": "array", - "xml": { - "name": "photoUrl", - "wrapped": true - }, - "items": { - "type": "string" - } - }, - "tags": { - "type": "array", - "xml": { - "name": "tag", - "wrapped": true - }, - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string", - "description": "pet status in the store", - "enum": [ - "available", - "pending", - "sold" - ] - } - } - } - }, - "400": { - "description": "Invalid ID supplied" - } - }, - "security": [ - { - "api_key": [] - }, - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, "/pet/{petId}": { "get": { "tags": [ @@ -630,33 +442,6 @@ ] } }, - "/store/inventory?response=arbitrary_object": { - "get": { - "tags": [ - "store" - ], - "summary": "Fake endpoint to test arbitrary object return by 'Get inventory'", - "description": "Returns an arbitrary object which is actually a map of status codes to quantities", - "operationId": "getInventoryInObject", - "produces": [ - "application/json", - "application/xml" - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "object" - } - } - }, - "security": [ - { - "api_key": [] - } - ] - } - }, "/store/order": { "post": { "tags": [ @@ -690,62 +475,7 @@ "400": { "description": "Invalid Order" } - }, - "security": [ - { - "test_api_client_id": [], - "test_api_client_secret": [] - } - ] - } - }, - "/store/findByStatus": { - "get": { - "tags": [ - "store" - ], - "summary": "Finds orders by status", - "description": "A single status value can be provided as a string", - "operationId": "findOrdersByStatus", - "produces": [ - "application/json", - "application/xml" - ], - "parameters": [ - { - "name": "status", - "in": "query", - "description": "Status value that needs to be considered for query", - "required": false, - "type": "string", - "enum": [ - "placed", - "approved", - "delivered" - ], - "default": "placed" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Order" - } - } - }, - "400": { - "description": "Invalid status value" - } - }, - "security": [ - { - "test_api_client_id": [], - "test_api_client_secret": [] - } - ] + } } }, "/store/order/{orderId}": { @@ -782,15 +512,7 @@ "400": { "description": "Invalid ID supplied" } - }, - "security": [ - { - "test_api_key_header": [] - }, - { - "test_api_key_query": [] - } - ] + } }, "delete": { "tags": [ @@ -1007,18 +729,6 @@ "description": "successful operation", "schema": { "$ref": "#/definitions/User" - }, - "examples": { - "application/json": { - "id": 1, - "username": "johnp", - "firstName": "John", - "lastName": "Public", - "email": "johnp@swagger.io", - "password": "-secret-", - "phone": "0123456789", - "userStatus": 0 - } } }, "400": { @@ -1091,12 +801,7 @@ "400": { "description": "Invalid username supplied" } - }, - "security": [ - { - "test_http_basic": [] - } - ] + } } } }, @@ -1114,29 +819,6 @@ "write:pets": "modify pets in your account", "read:pets": "read your pets" } - }, - "test_api_client_id": { - "type": "apiKey", - "name": "x-test_api_client_id", - "in": "header" - }, - "test_api_client_secret": { - "type": "apiKey", - "name": "x-test_api_client_secret", - "in": "header" - }, - "test_api_key_header": { - "type": "apiKey", - "name": "test_api_key_header", - "in": "header" - }, - "test_api_key_query": { - "type": "apiKey", - "name": "test_api_key_query", - "in": "query" - }, - "test_http_basic": { - "type": "basic" } }, "definitions": { @@ -1257,8 +939,7 @@ "properties": { "id": { "type": "integer", - "format": "int64", - "readOnly": true + "format": "int64" }, "petId": { "type": "integer", @@ -1288,150 +969,6 @@ "xml": { "name": "Order" } - }, - "$special[model.name]": { - "properties": { - "$special[property.name]": { - "type": "integer", - "format": "int64" - } - }, - "xml": { - "name": "$special[model.name]" - } - }, - "Return": { - "description": "Model for testing reserved words", - "properties": { - "return": { - "type": "integer", - "format": "int32" - } - }, - "xml": { - "name": "Return" - } - }, - "Name": { - "description": "Model for testing model name same as property name", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "integer", - "format": "int32" - }, - "snake_case": { - "readOnly": true, - "type": "integer", - "format": "int32" - } - }, - "xml": { - "name": "Name" - } - }, - "200_response": { - "description": "Model for testing model name starting with number", - "properties": { - "name": { - "type": "integer", - "format": "int32" - } - }, - "xml": { - "name": "Name" - } - }, - "Dog" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { - "type" : "object", - "properties" : { - "breed" : { - "type" : "string" - } - } - } ] - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { - "type" : "object", - "properties" : { - "declawed" : { - "type" : "boolean" - } - } - } ] - }, - "Animal" : { - "type" : "object", - "discriminator": "className", - "required": [ - "className" - ], - "properties" : { - "className" : { - "type" : "string" - } - } - }, - "format_test" : { - "type" : "object", - "required": [ - "number" - ], - "properties" : { - "integer" : { - "type": "integer" - }, - "int32" : { - "type": "integer", - "format": "int32" - }, - "int64" : { - "type": "integer", - "format": "int64" - }, - "number" : { - "type": "number" - }, - "float" : { - "type": "number", - "format": "float" - }, - "double" : { - "type": "number", - "format": "double" - }, - "string" : { - "type": "string" - }, - "byte" : { - "type": "string", - "format": "byte" - }, - "binary" : { - "type": "string", - "format": "binary" - }, - "date" : { - "type": "string", - "format": "date" - }, - "dateTime" : { - "type": "string", - "format": "date-time" - }, - "password" : { - "type": "string", - "format": "password" - } - } } } }