Unable to set different content-types for different response types for an endpoint
Open
affected-very-few
area-mvc
enhancement
feature-openapi
severity-major
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
In my OpenAPI document, I would like to be able to set different content-types for different response types.
For e.g for a GET request, I would like to set `application/json` for a _200_ object result and `application/problem+json` for _404_ problem details result. So `ProducesResponseType `should take content-type as an optional parameter in the constructor or `Produces` should take status code.
Currently, I can only set the content-type(s) in the `Produces` filter. But this applies the content-types to all the response types.
Contributor guide
Assessment
This issue has not been assessed yet.