I am using the latest version of Swashbuckle 5.1.3 and notice that there is a new SwaggerResponse attribute that allows you to document the type of response for each response code. For instance:
( https://github.com/domaindrivendev/Swashbuckle/issues/175 <may be useful).
/// <summary> /// Lovely. /// </summary> /// <param name="blah">Blah blah blah.</param> /// <returns>Something special.</returns> /// <response code="200">OK very nice.</response> /// <response code="400">Invalid request.</response> [SwaggerResponse(HttpStatusCode.OK, "A", typeof(Foo))] [SwaggerResponse(HttpStatusCode.BadRequest, "B", typeof(Bar))] public IHttpActionResult Get(string blah) { // Some code }
The original response class is documented, but further down, where it shows the "Response Messages" table, the response model is empty (for 400 Bad Request). It is impossible to see anywhere on the screen where a different type of response is documented.
source share