We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When I try to set an example for GET requests swagger does not generate it.
To Reproduce
/** * GET /example * @summary Example * @description Get example for some input. * @param {string} param1.query.required - First param * @param {number} param2.query.required - Second param * @return {object} 200 - Success response * @return {object} 400 - Bad request response * @example request * { * "param1": "hi", * "param2": 500 * } * @example response - 200 - Success response example * { * "hello": "world" * } * @example response - 400 - Invalid input * { * "error": "Invalid input" * } */
Expected behavior I expect the generated json to include examples for the request, but actually here is the path I get:
path
"paths": { "/example": { "get": { "deprecated": false, "summary": "Example", "description": "Get example for some input.", "security": [], "responses": { "200": { "description": "Success response", "content": { "application/json": { "schema": { "type": "object" }, "examples": { "example1": { "summary": "Success response example", "value": { "hello": "world" } } } } } }, "400": { "description": "Bad request response", "content": { "application/json": { "schema": { "type": "object" }, "examples": { "example2": { "summary": "Invalid input", "value": { "error": "Invalid input" } } } } } } }, "parameters": [ { "name": "param1", "in": "query", "description": "First param", "required": true, "deprecated": false, "schema": { "type": "string" } }, { "name": "param2", "in": "query", "description": "Second param", "required": true, "deprecated": false, "schema": { "type": "number" } } ], "tags": [] } } }
Screenshots
The text was updated successfully, but these errors were encountered:
Hi @tkeidar right now we only support examples for request body and responses. We will mark this as an enhancement.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When I try to set an example for GET requests swagger does not generate it.
To Reproduce
Expected behavior
I expect the generated json to include examples for the request, but actually here is the
path
I get:Screenshots
The text was updated successfully, but these errors were encountered: