You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the OpenAPI 2.0 document below, Swagger UI renders the Response content type drop down and tries to pass an Accept header even though the DELETE operation does not have a produces: value
swagger: "2.0"info:
version: "1"title: Delete prompts for Accept media typedescription: Delete prompts for Accept media typebasePath: /delete-acceptschemes:
- "http"paths:
/models/{modleId}:
delete:
summary: Delete a modeldescription: "Even though this operation does not produce anything, Swagger UI still prompts for and passes the Accept: header"operationId: deleteModelparameters:
- name: modelIdin: pathrequired: truetype: stringdescription: The ID of the model to deleteresponses:
204:
description: No Content. The model was deleted.404:
description: Not Found
It's one of the downsides of 2.0. Often people write definitions that don't specify the produces even when there is a chance to get a payload. We could enhance the behavior by checking if a 2XX/default response has a schema, and only then set the default to application/json.
DavidBiesack
changed the title
UI redners the "Response content type" Drop down for operations with no produces
UI renders the "Response content type" Drop down for operations with no produces
Aug 11, 2017
For the OpenAPI 2.0 document below, Swagger UI renders the Response content type drop down and tries to pass an Accept header even though the DELETE operation does not have a produces: value
Try it out -> execute shows the command:
The screenshot shows the rendering
The text was updated successfully, but these errors were encountered: