Swashbuckle.webapi: 201-created shows up as a response with status 200 in swagger-ui

Created on 31 Mar 2016  路  2Comments  路  Source: domaindrivendev/Swashbuckle.WebApi

I have a post endpoint where i would like to return a 201, If i use <response code="201"> Created</response> with [ResponseType(typeof(mytype))] with the addition of [SwaggerResponses] - it doesn't show my swaggerresponses, but shows the correct return code and type.
2016-03-31_11-35-44

If I on the other hand, only use SwaggerResponses and not the xml responses, it shows an empty 200 and all of my swaggerresponses.

2016-03-31_11-31-47

Most helpful comment

[SwaggerResponseRemoveDefaults] fixed it

All 2 comments

I'm going to close this issue and refer you to a thread toward the end of a previous issue that should answer your question:

https://github.com/domaindrivendev/Swashbuckle/pull/259#issuecomment-87715485

[SwaggerResponseRemoveDefaults] fixed it

Was this page helpful?
0 / 5 - 0 ratings