zio-flow icon indicating copy to clipboard operation
zio-flow copied to clipboard

Always flatten http operation input tuples

Open petoalbert opened this issue 3 years ago • 0 comments

If I define an API for a http operation like this:

Api.get("example" / string / int).query(boolean("a") ++ double("b"))

I would expect the Input type parameter to be like this: (String, Int, Boolean, Double), but instead it would be like this: (String, Int, (Boolean, Double)). That is because query will take a RequestInput[A] where A will already be a tuple in this case, and the implicit zipper will just append this tuple (unflattened) to (String, Int).

This is not an issue of correctness, the DSL is working properly as of now, but I think it would look nicer input types would not be nested like this.

petoalbert avatar Jun 09 '22 10:06 petoalbert