Skip to content

Instantly share code, notes, and snippets.

@danielplawgo
Created November 18, 2019 04:54
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 danielplawgo/a8bb1e3ecc2fa66cf22cc0a82d55539c to your computer and use it in GitHub Desktop.
Save danielplawgo/a8bb1e3ecc2fa66cf22cc0a82d55539c to your computer and use it in GitHub Desktop.
Import WebApi do Postmana z użyciem Swagger
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Add only Json formatter for Postman import
config.Formatters.Clear();
config.Formatters.Add(new JsonMediaTypeFormatter());
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment