Created
November 18, 2019 04:54
-
-
Save danielplawgo/a8bb1e3ecc2fa66cf22cc0a82d55539c to your computer and use it in GitHub Desktop.
Import WebApi do Postmana z użyciem Swagger
This file contains hidden or 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(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