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

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -