Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active August 3, 2017 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/84d0bef8677e3543b210e934d1c26a9b to your computer and use it in GitHub Desktop.
Save justinyoo/84d0bef8677e3543b210e934d1c26a9b to your computer and use it in GitHub Desktop.
Swashbuckle Pro Tips for ASP.NET Web API #1
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