I was wondering if anyone has come across a workaround when using Swagger
/ Swashbuckle 5.0.1
to document a single operation which can have multiple actions against it. For example, take the following:
api/products
api/products?productType='cheese'
When attempting to generate the docs I get an error suggesting this is not supported. However, the Swagger docs suggest there is a workaround by doing a merge.
I don't understand what they mean by this and how to go about doing it. Can anyone provide any information?
The only workaround I have been able to find as suggested in their documentation is to do the following (resolve using the first entry):
c.ResolveConflictingActions(x => x.First());
This isn't ideal as from an API perspective I want all the variations present / visible.
As stated in Swashbuckle SwaggerConfig.cs file on this setting:
In contrast to WebApi, Swagger 2.0 does not include the query string component when mapping a URL
This is not a Web API issue here, Swagger 2.0 spec does not actually support having query parameters.
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