Swagger.Net
Swagger.Net copied to clipboard
Support AttributeRouting
Trying to get your included sample to work with AR by adding these to the BlogPostsController
[RoutePrefix("api/BlogPosts")]
[DefaultHttpRouteConvention]
and using the following AR routing setup
public static void RegisterRoutes(HttpRouteCollection routes) {
// See http://github.com/mccalltd/AttributeRouting/wiki for more options.
// To debug routes locally using the built in ASP.NET development server, go to /routes.axd
routes.MapHttpAttributeRoutes(config =>
{
config.AutoGenerateRouteNames = true;
config.UseLowercaseRoutes = true;
config.AddRoutesFromAssembly(Assembly.GetExecutingAssembly());
config.RouteNameBuilder = RouteNameBuilders.Unique;
}
);
}
But only the GET endpoint shows up in the Swagger UI. If you check /routes.axd, you can see the list of route names and urls.