Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing swagger support for spec/coll-of #175

Open
slipset opened this issue Mar 19, 2019 · 1 comment
Open

missing swagger support for spec/coll-of #175

slipset opened this issue Mar 19, 2019 · 1 comment

Comments

@slipset
Copy link
Contributor

slipset commented Mar 19, 2019

spec-tools.visitor has
(defmethod visit-spec 'clojure.spec.alpha/coll-of ...) which ends up dispatching on

(case type
                   :map-of ::map-of
                   :set ::set-of
                   :vector ::vector-of)

while there is no implementation of accept-spec for any of #{::visitor/map-of, ::visitor/set-of, ::visitor/vector-of}

I've tried to add a

(defmethod swagger/accept-spec ::vector-of [_ _ children _]
  (println "CHILDREN-VECTOR-OF" (util/pp children))
  {:enum children :type "string"})

this prints CHILDREN-VECTOR-OF [{}]

This leads me to suspect that the implementation of visit-spec for clojure.spec.alpha/coll-of is flawed.

@ikitommi
Copy link
Member

If you have time to investigate & to fix, help would be most welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants