-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extended examples #35
base: master
Are you sure you want to change the base?
Conversation
"handles both requests" | ||
[get-params post-params request] | ||
(if (= (:request-method request) :get) | ||
(s/with-fn-validation (get-handler get-params)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with-fn-validation is not thread-safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is kekkonen.core/input-coerce!
that can be used for this => uses the registered http-coercions and produces identical errors than the standard coercion.
Thanks for the PR. I think it the support for multiple different http-methods should be implemented in the ring-adapter so that the api meta datas are in sync so that a) coherent validation exceptions are thrown and b) schema docs are in sync. Added for comment to the source. |
Some help with kekkonen.core/input-coerce! would be helpful. |
Ok, I agree having support for multiple different http-methods in this way is not the best but at least it shows how to use config to bend library to your needs. |
Proposing a new project with example of extended config usage.
Provided a variation how to set Get and Post on the same url but have different handlers.
Also there are examples of error handling and interceptors.