Swagger: support for additional routes

I have a route with an optional parameter:

[Route("{categoryId?}")] public HttpResponseMessage Get(int? categoryId=null) 

However, when I do not provide a value for categoryId , the call includes {categoryId?} In the request itself ...

 http://myhost/api/%7BcategoryId%7D 
+5
source share
1 answer

Swagger does not support advanced path parameters. If you want to document it this way, you need to create two separate paths: one with no path parameter and one with.

+5
source

All Articles