Skip to content

Swagger-UI: not respecting content-type for DELETE #1111

@psinghsp

Description

@psinghsp

I have Swagger 1.2 spec - part of which looks like this. Swagger-UI insists on setting the content-type header to "application/json" when DELETE operation is performed on an id. This causes our server to choke because it ends up parsing an empty string as JSON. How do I tell Swagger-UI to set the content-type to "text/html". I set the tag: "consumes: [text/html]" - but that did not have any effect.

                {
                    "httpMethod": "DELETE",
                    "summary": "Delete a tunnel by id (name)",
                    "nickname": "tunnelsByIdDelete",
                    "responseClass": "void",
                    "produces": ["text/html"],
                    "parameters": [
                        {
                            "name": "id",
                            "description": "Name of the tunnel to be deleted",
                            "paramType": "path",
                            "required": true,
                            "dataType" : "string"
                        }
                    ]
                }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions