I’m creating an api where an arbitrary number of query parameters can be added.
The API looks something like this:
GET /api/example?param1=value1¶m2=value2¶m3=value3
By default when Swashbuckle generates the Swagger UI it only includes parameters that are explicitly defined at the action method level.
Luckily the Open API spec supports this starting from version 3 through ‘free form query parameters’.
At the spec level this looks like this:
To achieve this using Swashbuckle you can use an operation filter:
This will generate the following UI: