spec-tools icon indicating copy to clipboard operation
spec-tools copied to clipboard

Specs with dynamically resolved `set` fail to transform

Open werenall opened this issue 1 year ago • 0 comments

(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.

werenall avatar Jan 10 '24 14:01 werenall