Hello, I’m trying to define a Tapir endpoint that has two OptionalMultiQueryParamDecoderMatcher query parameters.
Let’s say one parameter has the name id and the other name, such that I could call the endpoint with something like:
GET/find?id=1a&id=1b&name=foo&name=bar
I have a HTTP4S route that works with this using OptionalMultiQueryParamDecoderMatcher[String]("id"), which can then be mapped to a List[String]
I would really like to do this with Tapir, but I’m having difficulty finding examples or documentation for such a solution ( copilot isn’t helping either )
That doesn’t appear to work. While the request contains multiple values with the same key, the parameters picked up on the server only sees the last one
Oh, what did you have to change in the codecs? For me it simply worked with query[List[String]]("id").
By the way, the approach with queryParams would work as well, but the documentation wouldn’t be precise - the id parameter wouldn’t get listed there, as the documentation interpreter would have no way of knowing that you’re using such a parameter.