Skip to content

Mimetypes set by consumes/produces are ignored #37

@x12a1f

Description

@x12a1f

The global and per request consumes and produces properties are ignored.

Dapperdox does not provide a way to select the mime type of data being send but always assumes data send is "application/json".
It also does not provide a way to select the mime type of the data you want to receive. It seems to not touch the Accept header which in my case means it is set to "text/plain, */*; q=0.01" causing the server to return XML instead of JSON.

I would expect dropdowns listing the mimetypes listed in the consumes/produces to select what data is send/expected.

In swaggerui a dropdown is shown for selecting what the mime type is of the body send or the mime type of the expected result:

selection_212

selection_213

Minimal example:

{
  "x-navigateMethodsByName": true,
  "info": {
    "title": "minimal"
  },
  "swagger": "2.0",
  "host": "localhost:3123",
  "paths": {
    "/account": {
      "post": {
        "parameters": [ { "in": "body", "schema": { "type": "string", "title": "something" } } ],
        "summary": "post",
        "consumes": [
          "application/json",
          "application/json-patch+json"
        ],
        "produces": [
          "application/json",
          "text/xml"
        ],
        "responses": {
          "200": {
            "description": "Success",
              "schema": {
                  "title": "response",
                  "type": "string"
            }
          }
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions