Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doc failing to generate multiple actions single operation

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.

like image 710
Dr Schizo Avatar asked Mar 03 '15 18:03

Dr Schizo


1 Answers

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.

like image 136
Benjamin Soulier Avatar answered Oct 29 '22 10:10

Benjamin Soulier