I'm currently working this on ASP.NET Core 3.0 using Swashbuckle.AspNetCore, but I would like to know the case for OpenAPI 3.0 Specification in case anyone else knows better.
I try currently set the specification with Nuget library so that normally return values are content-type: application/json
, but in exceptional cases content-type: application/problem+json
. This does not appear to be possible out-of-the-box in ASP.NET Core 3.0 & Swashbuckle (or I sorely missed it). Is this correct? If not out-of-the-box, what could be the way to do this systematically?
Is it possible in OpenAPI specification? I'm inclined to believe it probably is, but missed it while trying to glance through the specification.
Here is a image for the automatically generated documentation and HTTP 400 case I would like show only application/problem+json
as the return value.