spec-tools
spec-tools copied to clipboard
missing swagger support for `spec/coll-of`
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.
If you have time to investigate & to fix, help would be most welcome.