Fork me on GitHub
#ring-swagger
<
2016-01-12
>
currentoor23:01:41

I want to do something like this but I can't get it to work.

(GET* "/all" []
                   :query-params [{where     :- {s/Keyword s/Any} nil}
                                  {where_any :- {s/Keyword s/Any} nil}]
                   :return [sch/Organization]
                   (resp (query/all-organizations conn where where_any)))

currentoor23:01:14

is it possible to specify a map as input to a GET request?

mtkp23:01:34

@currentoor: can you elaborate? is the client sending a map of some kind?

mtkp23:01:29

oh i see. map in the query params

currentoor23:01:09

yeah, i can just use

(GET* "/all" []
                   :query-params [{where     :- s/Any nil}
                                  {where_any :- s/Any nil}]
                   :return [sch/Organization]
                   (resp (query/all-organizations conn where where_any)))

currentoor23:01:20

but then i have to call a json parser myself

currentoor23:01:34

which isn't terrible

currentoor23:01:48

just figured i'd use the built in solution if possible

mtkp23:01:32

are you putting a json string as the value to where and where_any?

currentoor23:01:46

url encoded json string