swagger-api / swagger-api/swagger-ui
UI renders the "Response content type" Drop down for operations with no produces
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
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 type
description: Delete prompts for Accept media type
basePath: /delete-accept
schemes:
- "http"
paths:
/models/{modleId}:
delete:
summary: Delete a model
description: "Even though this operation does not produce anything,
Swagger UI still prompts for and passes the Accept: header"
operationId: deleteModel
parameters:
- name: modelId
in: path
required: true
type: string
description: The ID of the model to delete
responses:
204:
description: No Content. The model was deleted.
404:
description: Not Found
Try it out -> execute shows the command:
curl -X DELETE "http://localhost/delete-accept/models/{modleId}" -H "accept: application/json"
The screenshot shows the rendering

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in Swagger UI with the provided OpenAPI 2.0 document and inspect the response content type control and generated request. Done means a DELETE operation without a produces value has no Response content type dropdown and does not send an Accept header; verify the generated curl command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100