Extended examples - #35
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.
with-fn-validation is not thread-safe
There was a problem hiding this comment.
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.