Reputation: 395
I see many examples with ASP.NET Core that explains on how to set valid produces/consumes media types using swagger on ASP.NET Core MVC but I am unable to figure out how should I set the valid produce/consumes media types on MVC 5 running on .net framework 4.7. Please Help. I tried using [Produces("application/JSON")] attribute but system complains about Produces attribute not found. I think this is specific to mvc in .net core and not for .net framework 4.7. I have installed swashbuckle Nuget package only. Do I need to install any other package?
Thank you.
Upvotes: 1
Views: 3111
Reputation: 71
I used a variation on this example, https://blog.kloud.com.au/2017/08/04/swashbuckle-pro-tips-for-aspnet-web-api-part-1/ I implemented ProducesAttribute and ConsumesAttribute decorators, and looked for both decorators in an IOperation.Appy filter method.
Upvotes: 2