clojure - How can I only use conforming values of a map? -


in forbidden keys in clojure.spec, accepted answer states can't forbid keys because should ignore values you're not interested.

however, there way map, containing keys validated , specced?

(s/def ::category (s/keys :req-un [::name ::description])) (s/conform ::category {:name "hugo" :description "asdf" :other 1}) 

gives me

{:name "hugo", :description "asdf", :other 1} 

but i'd get

{:name "hugo", :description "asdf"} 

of course don't want specify keys twice, defeat purpose. want make sure noone later uses keys aren't specced.


Comments

Popular posts from this blog

4x4 Matrix in Python -

wso2is - WSO2 IS 5.0.0 SP1 After restart there is authentication error -

python - PyInstaller UAC not working in onefile mode -