forked from swagger-api/swagger-codegen
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swagger-api#443 - Handling required parameters during swagger type di…
…scovery
- Loading branch information
Showing
3 changed files
with
129 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
modules/swagger-codegen/src/test/resources/2_0/requiredTest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</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": { | ||
"email": "apiteam@wordnik.com" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
} | ||
}, | ||
"host": "petstore.swagger.io", | ||
"basePath": "/v2", | ||
"schemes": [ | ||
"http" | ||
], | ||
"paths": { | ||
"/tests/requiredParams": { | ||
"get": { | ||
"tags": [ | ||
"tests" | ||
], | ||
"summary": "Operation with required parameters", | ||
"description": "", | ||
"operationId": "requiredParams", | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "param1", | ||
"in": "formData", | ||
"description": "Some required parameter", | ||
"required": true, | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
{ | ||
"name": "param2", | ||
"in": "formData", | ||
"description": "Some optional parameter", | ||
"required": false, | ||
"type": "string" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "successful operation. Retuning 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" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters