Specs with dynamically resolved `set` fail to transform
Open
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 606
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
(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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing visitor/spec-dispatch and the visit-spec handling described in the issue, then reproduce the two dynamically resolved set examples with json-schema/transform. Done means both direct and registered specs resolve the set form and produce the expected enum rather than an empty schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100