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
dynamic
202
Describe the bug
When the response status code is 202, the response body type is not generated properly.
For example, change "200" to "202" in pet_service_json.json:
"200"
"202"
pet_service_json.json
"/pet/{petId}": { "get": { "tags": [ "pet" ], "summary": "Find pet by ID", "description": "Returns a single pet", "operationId": "getPetById", "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "petId", "in": "path", "description": "ID of pet to return", "required": true, "type": "integer", "format": "int64" } ], "responses": { "202": { "description": "successful operation", "schema": { "$ref": "#/definitions/Pet" } }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" } }, },
The generated code looks like this:
Future<chopper.Response> petPetIdGet //...
But it should look like this:
Future<chopper.Response<Pet>> petPetIdGet //...
The type is lost when the status is 202.
I have a swagger JSON file full of such 202 responses, and currently the only workaround is to manually replace them with 200.
200
Library versions used: Latest example project
The text was updated successfully, but these errors were encountered:
Same thing if schema was under responses.200.content.application/json.schema which is for OpenAPI 3
responses.200.content.application/json.schema
It should be able to handle: responses.200.content.application/json.schema
Currently, it only handles: responses.200.schema
responses.200.schema
Ref: https://swagger.io/docs/specification/describing-responses/
Example:
{ "paths":{ "/health":{ "get":{ "responses":{ "200":{ "description":"Default Response", "content":{ "application/json":{ "schema":{ "type":"object", "properties":{ "message":{ "type":"string", "pattern":"ok" }, "uptime":{ "type":"number" }, "date":{ "type":"string", "format":"date-time" } }, "required":[ "message", "uptime", "date" ], "additionalProperties":false } } } } } } } } }
Sorry, something went wrong.
fryette
Vovanella95
Successfully merging a pull request may close this issue.
Describe the bug
When the response status code is
202
, the response body type is not generated properly.For example, change
"200"
to"202"
inpet_service_json.json
:The generated code looks like this:
But it should look like this:
The type is lost when the status is
202
.I have a swagger JSON file full of such
202
responses, and currently the only workaround is to manually replace them with200
.Library versions used:
Latest example project
The text was updated successfully, but these errors were encountered: