Skip to content
This repository has been archived by the owner on May 21, 2018. It is now read-only.

Support repeated (maybe nested) query parameters for httpGet querys #230

Open
emanresusername opened this issue Jul 26, 2016 · 0 comments
Open
Assignees

Comments

@emanresusername
Copy link
Contributor

The main ask is for repeated query params, which either flavor1 or flavor3 would support. Nested maps like in flavor2 would be awesome if possible! I know sinatra and rails support this syntax and will auto deserialize it to a hash, but not sure how widely applicable the model is though.

val app = uri"http://sinatra.app"
val flavor1 = Map("hello" -> "world", "nestedMap[listParams][]" -> List("elem1", "elem2"))
val flavor2 = Map("hello" -> "world", "nestedMap" -> Map("listParams" -> List("elem1", "elem2")))
val flavor3 = Seq("hello" -> "world", "nestedMap[listParams][]" -> "elem1", "nestedMap[listParams][]" -> "elem2")
val search = app.query(flavor1) // == app.query(flavor2) == app.query(flavor3)
search // http://jsonapi.compliant.app?hello=world&filter[listParams][]=elem1&filter[listParams][]=elem2
//server side deserializes to {"hello": "world", "nestedMap": {"listParams": ["elem1", "elem2"]}}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants