-
Notifications
You must be signed in to change notification settings - Fork 31
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
funcool.struct as validation library? #23
Comments
I like this, I actually wrote some custom code on the current validator to get it back into a map, this lib already returns a vector of |
This is still coming along, but I also wanted to start to try to let people customize which functions do what, so like… when you start the app in (ns server
(:require [coast]))
(def routes [[:get "/" :home]])
(def app (coast/app {:routes routes
:router custom-router
:validate custom-validation-fn-or-library
:email custom-emailer
:queue-job custom-job-queuer})) ; and so on This also means that the coast lib itself in clojars, won't have like 20 deps anymore, the template might have a bunch of deps in it, so if you want to customize the renderer or what have you, you'd choose what you want. Just trying to keep you in the loop, if you're still into it 👍 |
I am, and I appreciate it :) I haven't had much time lately to play with Coast, but I've been following the issues and your commits! Thanks for your work! |
BTW, I wouldn't worry too much about making everything ultra configurable. If I really, really want a different router I can rip it out myself, it's probably not worth making the code base super complicated for the common case. YAGNI and all that :) |
Have you checked out https://funcool.github.io/struct/latest/ as validation library? The featureset seems to be comparable to verily, except that struct is offering optional coercion and I like the way that custom validators are created better. Here is an example of a validator for a moustache-templated text I wrote:
The text was updated successfully, but these errors were encountered: