Skip to content

Instantly share code, notes, and snippets.

@wunki
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wunki/29705e712569c3b223c1 to your computer and use it in GitHub Desktop.
Save wunki/29705e712569c3b223c1 to your computer and use it in GitHub Desktop.
Is it possible with fnhouse to default limit to a certain value if it's not supplied? Currently it also raises an `missing-required-key` when it's not supplied because of the `s/Int`
(defnk $GET
{:responses {200 schemas/SomeSchema}
[[:request
[:query-params limit :- s/Int]
:as req]
[:resources flow :- FlowResource]]
(...)
@w01fe
Copy link

w01fe commented May 15, 2014

Yes, just use the optional key support, e.g. {limit :- s/Int 20}

@wunki
Copy link
Author

wunki commented May 15, 2014

That fixed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment