1

I have a self-hosted .net core API that I would like to auto-generate an Open API spec from. Swashbuckle does not support generating the spec if you use conventional routing (i.e., using MapRoute instead of attribute routing). Does anyone know if NSwag supports this? Maybe with ApiExplorer attributes?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Victor P
  • 1,496
  • 17
  • 29

2 Answers2

0

NSwag (and I think Swashbuckle too) use the ASP.NET Core api explorer to discover and get operation metadata. If conventional routing correctly populates API Explorer metadata then it should work...

Rico Suter
  • 11,548
  • 6
  • 67
  • 93
-1

You should try Swashbuckle.AspNetCore.SwaggerGen.ConventionalRouting which is an extension on top of Swashbuckle and supports conventional routes as well.

chsakell
  • 140
  • 1
  • 2