I'm using Swashbuckle.AspNetCore (4.0.1)
to generate a simple SwaggerUI for testing like it's described here. My ApiController have two routes:
[Route("api/values")]
[Route("api/{systemId}/values")]
The SwaggerUI displays all controller endpoints two times (one with systemId, one without systemId). This is good, but the problem is, when I click on e.g /api/values/example
SwaggerUI expands api/{systemId}/values/example
too. Both endpoints are going to the same public C# method inside the controller, it makes sense why SwaggerUI opens both. But it's annoying and confusing.
Is it possible to stop this behavior?
Add the Name
property to the Route.
[Route("api/values", Name = "values1")]
[Route("api/{systemId}/values", Name = "values2")]
This will create different ids in the div
containing the endpoint specifications so it will expand only the one you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With