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

fix breaking changes due to PR dependencies #224

Merged
merged 2 commits into from
Mar 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/spec_tools/json_schema.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
{:enum children})

(defn- maybe-with-title [schema spec options]
(letfn [(infer-titles? [options] (or (nil? (:infer-titles options)) (:infer-titles options)))]
(letfn [(infer-titles? [options] (-> options :infer-titles false? not))]
(if-let [title (and (infer-titles? options) (st/spec-name spec))]
(assoc schema :title (impl/qualified-name title))
schema)))
Expand Down Expand Up @@ -219,7 +219,8 @@
(map :required)
(reduce into (sorted-set))
(into []))}
spec))
spec
options))

(defmethod accept-spec 'clojure.spec.alpha/merge [_ spec children options]
(accept-merge children spec options))
Expand Down Expand Up @@ -259,13 +260,15 @@
(defmethod accept-spec 'clojure.spec.alpha/alt [_ spec children options]
(maybe-with-title
{:anyOf children}
spec))
spec
options))

(defmethod accept-spec 'clojure.spec.alpha/cat [_ spec children options]
(maybe-with-title
{:type "array"
:items {:anyOf children}}
spec))
spec
options))

; &

Expand Down