forked from loafle/openapi-generator-original
added test case, update for src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java
This commit is contained in:
parent
4c674ca94b
commit
59b477d2da
102
src/test/resources/postBodyTest.json
Normal file
102
src/test/resources/postBodyTest.json
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
"swagger": "2.0",
|
||||||
|
"info": {
|
||||||
|
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.wordnik.com\">http://swagger.wordnik.com</a> 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://helloreverb.com/terms/",
|
||||||
|
"contact": {
|
||||||
|
"name": "apiteam@wordnik.com"
|
||||||
|
},
|
||||||
|
"license": {
|
||||||
|
"name": "Apache 2.0",
|
||||||
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"host": "petstore.swagger.wordnik.com",
|
||||||
|
"basePath": "/v2",
|
||||||
|
"schemes": [
|
||||||
|
"http"
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"/animals": {
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"pet"
|
||||||
|
],
|
||||||
|
"summary": "Add a new animal to the store",
|
||||||
|
"description": "",
|
||||||
|
"consumes": [
|
||||||
|
"application/json",
|
||||||
|
"application/xml"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "body",
|
||||||
|
"name": "pet",
|
||||||
|
"description": "Animals",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/Animal"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"405": {
|
||||||
|
"description": "Invalid input"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/insects": {
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"pet"
|
||||||
|
],
|
||||||
|
"summary": "Add a new insect to the store",
|
||||||
|
"description": "",
|
||||||
|
"consumes": [
|
||||||
|
"application/json",
|
||||||
|
"application/xml"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "body",
|
||||||
|
"name": "pet",
|
||||||
|
"description": "Insects",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/Insect"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"405": {
|
||||||
|
"description": "Invalid input"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"definitions": {
|
||||||
|
"Animal": {
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Insect": {
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user