Fork me on GitHub
#yada
<
2017-02-25
>
kurt-yagram10:02:38

I know this question has been asked before (a few months ago), but we're a few months later now: are there any plans/projects using clojure.spec instead of prismatic/scheme in yada?

malcolmsparks10:02:54

For parameter validation?

kurt-yagram10:02:28

prismatic/scheme works pretty well, but I'd prefer clojure.spec these days. Well, clojure 1.9 is not released yet, so I fully understand yada is not switching (yet). I just wonder if there are any plans or projects busy replacing prismatic/scheme with clojure.spec .

dominicm13:02:59

@kurt-yagram I think there are still some limitations of specs that need exploring before it can be fully utilized. There are some contentions, for example: spec believes you should accept all keys, even extraneous. This goes against expectations for forms though. So yada needs to figure out a default here. The refactoring in 1.2 did a lot to split up the codebase. Schema is still quite entwined in the resource model of core yada though. I expect spec will eventually land. But it's not a feature being developed right now.

kurt-yagram13:02:36

allright, thanks! It's good to know...

dominicm13:02:37

I wonder if yada takes a function where it takes a schema? That might be a useful way to wrap up specs now. I'll probably investigate that tomorrow.

dominicm18:02:25

https://github.com/juxt/yada/blob/master/src/yada/parameters.clj Is based on the schema protocols, if you wrote a function to put a spec inside a protocol, it may just work... Though I think a function override would be better in all cases. Alternatively: rewrite the interceptor chain. Can't decide which is a better solution really.