Skip to content

Incorrect Accept header sent from Swagger-UI #485

@steine-locus

Description

@steine-locus

I've got a java webapp where I'm doing version control via content negotiation. My method looks like:

@POST
@Consumes("application/vnd.mycompany.foo.v1+json")
@Produces("application/vnd.mycompany.bar.v1+json")
@ApiOperation(...)
@ApiResponses(...)
public Response createBar(
        @ApiParam(required = true) final Foo foo) {
    ..
}

On the UI, for Parameter Content Type, I select "vnd.mycompany.foo.v1+json". When I [Try it out!], I get back a 406 Not Acceptable. These are the headers that go out:

Accept: application/json
Content-Type: application/vnd.mycompany.foo.v1+json; charset=UTF-8

So it's not surprising that I'm getting a 406, because my response type doesn't match the accept header. I asked on the google group (https://groups.google.com/forum/#!topic/swagger-swaggersocket/NCQ3ZP7RV40), and was told I should report this as a bug.

I just grabbed the latest build from Download ZIP on the homepage and still see the issue.

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