Fork me on GitHub
#clojure-spec
<
2017-08-06
>
scaturr16:08:58

How would s/conform work in an http context? Like how would I conform JSON payloads for specs defined with namespaced keys? Like if I have a spec for ::entity/id instead of just :id?

scaturr16:08:07

(s/conform ::entity {:id some-uuid}) -> invalid

dergutemoritz18:08:12

@scaturr You can use :req-un instead of :req to achieve what you want in this case

scaturr18:08:36

would that lead to a situation where you have specs exist just for json conforming? or can :req and :req-un co-exist?

scaturr18:08:43

seems like they could not

scaturr18:08:05

thank you for the suggestion though 🙂

stathissideris21:08:43

Just released spectacles: lenses for #clojure -- checked at runtime using #spec https://github.com/stathissideris/spectacles