2

I've got Web service methods which return the same HTTP response for different reasons, such as a 400 Bad Request for different qualities of posted data. I use Swashbuckle to generate the Swagger API documentation.

Until recently, I used HTML elements to document responses to list different causes for the same HTTP response. Example:

...
/// <response code="400"><ul>
///    <li>New member model missing.</li>
///    <li>Account name missing.</li>
///    <li>Password missing.</li>
/// </ul></response>
/// <response code="409"><ul>
///    <li>Data consistency issue.</li>
/// </ul></response>
...

While this used to work fine, since a fairly recent update of Swashbuckle the HTML isn't rendered properly anymore and instead, I get the HTML elements rendered as text. Example result:

enter image description here

Listing the responses multiple times doesn't work. Has anyone a working solution for this?

Quality Catalyst
  • 6,531
  • 8
  • 38
  • 62

1 Answers1

0

If it used to work but not anymore, it's probably an issue with Swashbuckle. Try using an older package version than the one you're using.

See Swashbuckle on NuGet for a listing of all versions (publicly) available.

If you find that the latest version indeed breaks this feature, file an issue with the developers. The correct place to list an issue is on Github:

Eric
  • 2,797
  • 2
  • 20
  • 19
  • I'll be ending up using an older Swashbuckle version indeed. Despite this is not answering my question, thank you for digging into this problem. I'll be checking on the new beta versions: they may have this fixed. – Quality Catalyst Feb 16 '17 at 21:39