From 64fd94262f1b36a98e60328b4453290e4a370bb1 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 10 Oct 2015 22:54:13 +0800 Subject: [PATCH] add globalConsumesAndProduces.json --- .../2_0/globalConsumesAndProduces.json | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json diff --git a/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json b/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json new file mode 100644 index 0000000000..221d00b6da --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json @@ -0,0 +1,149 @@ +{ + "swagger": "2.0", + "info": { + "description": "Spec for testing global consumes and produces", + "version": "1.0.0", + "title": "Swagger Petstore", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "email": "apiteam@swagger.io" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host": "petstore.swagger.io", + "basePath": "/v2", + "consumes": ["application/global_consumes"], + "produces": ["application/global_produces"], + "schemes": [ + "http" + ], + "paths": { + "/tests/localConsumesAndProduces": { + "get": { + "tags": [ + "tests" + ], + "summary": "Operation with local consumes and produces", + "description": "", + "operationId": "localConsumesAndProduces", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "successful operation. Returning a simple int.", + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "post": { + "tags": [ + "tests" + ], + "summary": "Operation with global consumes and produces", + "description": "", + "operationId": "globalConsumesAndProduces", + "parameters": [ + ], + "responses": { + "200": { + "description": "successful operation. Returning a simple int.", + "schema": { + "type": "integer", + "format": "int64" + } + } + } + } + }, + "/tests/globalConsumesAndProduces": { + "get": { + "tags": [ + "tests" + ], + "summary": "Operation with global consumes and produces", + "description": "", + "operationId": "globalConsumesAndProduces", + "parameters": [ + ], + "responses": { + "200": { + "description": "successful operation. Returning a simple int.", + "schema": { + "type": "integer", + "format": "int64" + } + } + } + } + }, + "/tests/localResetConsumesAndProduces": { + "get": { + "tags": [ + "tests" + ], + "summary": "Operation with local consumes and produces set to empty (reset)", + "description": "", + "operationId": "localResetConsumesAndProduces", + "parameters": [ + ], + "consumes": [], + "produces": [], + "responses": { + "200": { + "description": "successful operation. Returning a simple int.", + "schema": { + "type": "integer", + "format": "int64" + } + } + } + } + } + + }, + "securityDefinitions": { + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "header" + }, + "petstore_auth": { + "type": "oauth2", + "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", + "flow": "implicit", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + }, + "definitions": { + "CustomModel": { + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string", + "example": "doggie" + } + } + } + } +} \ No newline at end of file