Swashbuckle Swagger - How to annotate content types?
问题 How do I annotate my ASP.NET WebAPI actions so that the swagger metadata includes the content-types that my resources support? Specifically, I want the documentation to show that one of my resources can return the 'original' application/json and application/xml but also now returns a new format, application/vnd.blah+json or +xml . 回答1: What you need to do is this; Swagger spec: you need to add your response-type to the list of response-types for that operation "produces": [ "application/json"