spec-tools
spec-tools copied to clipboard
Specs with dynamically resolved `set` fail to transform
(json-schema/transform (set (keys {:a 1 :b 2})))
=> {:enum [:b :a]}
(s/def ::available-actions (set (keys {:a 1 :b 2})))
=> :dev/available-actions
(json-schema/transform ::available-actions)
=> {}
The problems seem to be that visitor/spec-dispatch
returns clojure.core/set
and there's no visit-spec
method for that so that a :default is used. And it never reaches the actual form resolution.