Closed wereii closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.
Bug description
Using
does not set (it actually does in the code, but sets it to
None
) content type on the route.vs.
This does automagically set the content type to
application/json
on the route.Screenshots The screenshots of Swagger UI if this bug is related to it.
To Reproduce
Expected behavior Getting
automatic content-type... similar behaviour of the same/similar features/logic between these twodoc.produces
anddoc.response(200, ...)
- in this instance it's detection of Content-Type.Basically I would expect that
doc.produces
is a shorthand fordoc.responce(200, ...)
but even looking under the hood, it seems to be somewhat different (why?).Environment:
sanic-openapi==0.6.1
swagger.json
```json { "basePath": null, "definitions": {}, "host": null, "info": { "version": "1.0.0", "title": "API", "description": "", "termsOfService": "", "contact": { "email": null }, "license": { "name": null, "url": null } }, "paths": { "/status/produces": { "get": { "operationId": "health.status_produces", "consumes": [ "application/json" ], "produces": [ null ], "tags": [ "health" ], "parameters": [], "responses": { "200": { "schema": { "type": "object", "properties": { "status": { "type": "string" } } }, "description": "Always returns {\"test\": \"OK\"}." } } } }, "/status/response": { "get": { "operationId": "health.status_response", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "health" ], "parameters": [], "responses": { "200": { "schema": { "type": "object", "properties": { "test": { "type": "string" } } }, "description": "Always returns {\"test\": \"OK\"}." } } } } }, "schemes": [ "http" ], "security": null, "securityDefinitions": null, "swagger": "2.0", "tags": [ { "name": "health" } ] } ```