ring-swagger 2023-03-21

Hi - does anyone know how to get swagger to accept arbitrary query parameters? I have an API endpoint which accepts query params like /api/endpoint?foo=1&bar=2... where foo and bar are not known until runtime. Ideally, I'd like to receive a map, but just being able to receive the string would be fine. I also need the Swagger UI to recognize this and allow me to specify additional parameters. Here are a couple of posts explaining in more detail. https://github.com/metosin/compojure-api/issues/455 https://stackoverflow.com/questions/62714438/swagger-openapi-custom-parameters-in-the-request

Here's an explanation for how to do it using raw Swagger, but I can't figure out how to get it to work with compojure-api: https://stackoverflow.com/questions/49582559/how-to-document-dynamic-query-parameter-names-in-openapi-swagger

Thanks so much, @juhoteperi. Very helpful.

The first answer mentions this is possible on OpenAPI 3, not 2. Compojure-API just outputs Swagger = OpenAPI 2. > Free-form query parameters can be described using OpenAPI 3.x, but not OpenAPI 2.0

Next Reitit version will have OpenAPI 3 support though: https://github.com/metosin/reitit/blob/master/CHANGELOG.md#unreleased