Skip to content

UI omits the accept (Response Content Type) dropdown for non-JSON response #2425

@DavidBiesack

Description

@DavidBiesack

For the Swagger below, the produces is XML, not JSON. (We don't have a schema because this is an external spec, application/gml+xml )
The POST operation does not show the Response Content Type drop down, so the user cannot select the media type. (and if produces only contains one, it should still show that type, for documentation purposes, as is done if there is only one JSON media type.)

Swagger UI is 2.2.3

Swagger document:

{
    "swagger": "2.0",
    "info": {
        "version": "1",
        "title": "No Response Content Type when produces XML",
        "description": "The UI omits the response content type drop down for non-JSON"
    },
    "schemes": [ "http" ],
    "host": "www.example.com",
    "basePath": "/producesXml",
    "paths": {
        "/service": {
            "post": {
                "summary": "Create a resource",
                "produces": [
                    "application/gml+xml",
                    "application/xml"
                ],
                "consumes": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "regionId",
                        "in": "query",
                        "description": "The GML region ID",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK, application/gml+xml resonse returned",
                        "type" : "string"
                    }
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions