Query Parameters that are Dictionarys


I want to define a query parameter for an endpoint like so:

case class Input(
  object: Option[MyCustomObject],

case class MyCustomObject(
  foo: Int, 
  bar: String

where this endpoint accepts requests like at a path uri like “path?object[foo]=0&object[bar]=baz”

Is this possible to do with a custom codec?

I’m afraid this type of functionality (objects passed through query parameters) isn’t yet supported. Please create a feature request.

For the time being, you’ll have to manually extract the query parameters and map them to your object. The @query annotation only supports extracting query parameters where the name matches the argument exactly.