Swagger-UI Accept header

1,392 views
Skip to first unread message

Eric Stein

unread,
Jun 26, 2014, 3:52:23 PM6/26/14
to swagger-sw...@googlegroups.com
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.eim.initial.query.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. How does Swagger-UI deal with this?

Thanks,
Eric

Ron

unread,
Jun 27, 2014, 4:24:19 AM6/27/14
to swagger-sw...@googlegroups.com
Eric,

This sounds like a possible bug in the Swagger-UI. I don't believe this is a common use case so it's possible nobody encountered it.
Feel free to open an issue about it on the swagger-ui repo.


--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Stein

unread,
Jun 27, 2014, 10:31:42 AM6/27/14
to swagger-sw...@googlegroups.com
Thanks, Ron. I have raised swagger-ui 485.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Eric Stein

unread,
Jun 27, 2014, 11:27:15 AM6/27/14
to swagger-sw...@googlegroups.com
How do I figure out what version of swagger-ui I have? It is possible the issue has been fixed.

Ron

unread,
Jun 27, 2014, 11:39:49 AM6/27/14
to swagger-sw...@googlegroups.com
Look at the swagger.js file.


To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Tony Tam

unread,
Jun 27, 2014, 11:41:23 AM6/27/14
to <swagger-swaggersocket@googlegroups.com>
Swagger-ui.js actually

Eric Stein

unread,
Jun 27, 2014, 4:59:22 PM6/27/14
to swagger-sw...@googlegroups.com
Meh. I'm using 2.0.17, which should be the most recent, and I'm still seeing it. I was hopeful because it looks from your issue history like you've had this bug before. Oh, well. I'll wait for a response on the issue, I guess.

Thanks,
Eric
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages