Fork me on GitHub
#ring-swagger
<
2017-02-02
>
borkdude15:02:58

How do I get the :query-params after they have been validated and defaults filled in, all in a map?

borkdude15:02:24

e.g.:

:query-params [term :- s/Str,
                      {strategy :- s/Str "suggest"},
                      {uri :- s/Str nil}
                      {max :- s/Int nil}]

ikitommi15:02:28

if you are only interested in the whole map, you can use :query [params {:term s/Str, ...}]

ikitommi15:02:25

Also, there is :as in the plumbimg fnk notation: :query-params [a :- s/Str :as params]

ikitommi15:02:05

did you try the inline help? is it any good?

borkdude15:02:55

@ikitommi Is that in 1.1.10?

ikitommi15:02:27

in the latest alpha only.

ikitommi15:02:02

but there is :query, :body, :header etc. which use the let-binding and same with -params using the letk-binding.

borkdude15:02:09

I’ll try it in a different REPL session 🙂

ikitommi15:02:42

cool, didn't think of that :)

ikitommi15:02:25

oh, require the compojure.api.meta to get those docs in.

ikitommi15:02:16

might have to move those into help to get them preloaded.

borkdude15:02:52

so in my case I would have found it at (help/help :meta :header-params) right?

ikitommi15:02:52

and the (help/help :meta) shows them all.

borkdude15:02:51

ok cool, thank you

ikitommi15:02:28

and (help/help) for help on help.

singen15:02:26

Hey, anyone using ring-onelog with compojure-api? I’m seeing the entire api description dumped into stdouterr whenever an exception happens. This seems to be the culprit: https://github.com/nberger/ring-logger/blob/master/src/ring/logger/messages.clj#L137

singen15:02:11

I don’t know enough about ring to configure this

nberger15:02:46

@singen it seems like that println should not be there. I'd happily accept a PR removing it :)

singen15:02:38

ooooook 🙂

nberger16:02:37

Thanks, will merge it and release in the next few hours