-
-
Save justinyoo/84d0bef8677e3543b210e934d1c26a9b to your computer and use it in GitHub Desktop.
Swashbuckle Pro Tips for ASP.NET Web API #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WebApiConfig | |
{ | |
public static void Register(IAppBuilder app) | |
{ | |
... | |
var mediaType = new MediaTypeHeaderValue("application/json"); | |
var formatter = new JsonMediaTypeFormatter(); | |
formatter.SupportedMediaTypes.Clear(); | |
formatter.SupportedMediaTypes.Add(mediaType); | |
var config = new HttpConfiguration(); | |
config.Formatters.Clear(); | |
config.Formatters.Add(formatter); | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment