diff --git a/modules/reitit-spec/src/reitit/coercion/spec.cljc b/modules/reitit-spec/src/reitit/coercion/spec.cljc index 7bee7da6..52fb65e8 100644 --- a/modules/reitit-spec/src/reitit/coercion/spec.cljc +++ b/modules/reitit-spec/src/reitit/coercion/spec.cljc @@ -26,17 +26,20 @@ (defprotocol IntoSpec (into-spec [this name])) +(defn- ensure-name [?name] + (or ?name (keyword "" (name (gensym "spec"))))) + (extend-protocol IntoSpec #?(:clj clojure.lang.PersistentArrayMap :cljs cljs.core.PersistentArrayMap) (into-spec [this name] - (ds/spec name this)) + (ds/spec (ensure-name name) this)) #?(:clj clojure.lang.PersistentHashMap :cljs cljs.core.PersistentHashMap) (into-spec [this name] - (ds/spec name this)) + (ds/spec (ensure-name name) this)) Spec (into-spec [this _] this) @@ -79,7 +82,7 @@ (for [[k response] responses] [k (update response :body #(coercion/-compile-model this % nil))]))))) (-compile-model [_ model name] - (into-spec model (or name (gensym "spec")))) + (into-spec model name)) (-open-model [_ spec] spec) (-encode-error [_ error] (-> error diff --git a/project.clj b/project.clj index 989867ab..49899da5 100644 --- a/project.clj +++ b/project.clj @@ -16,7 +16,7 @@ [metosin/reitit-schema "0.1.0-SNAPSHOT"] [meta-merge "1.0.0"] - [metosin/spec-tools "0.5.1"] + [metosin/spec-tools "0.6.1"] [metosin/schema-tools "0.10.0-SNAPSHOT"]] :plugins [[jonase/eastwood "0.2.5"] @@ -42,12 +42,12 @@ [metosin/reitit] [metosin/schema-tools "0.10.0-SNAPSHOT"] - [expound "0.4.0"] + [expound "0.5.0"] [orchestra "2017.11.12-1"] [ring "1.6.3"] - [metosin/muuntaja "0.4.1"] - [metosin/jsonista "0.1.0"] + [metosin/muuntaja "0.5.0"] + [metosin/jsonista "0.1.1"] [criterium "0.4.4"] [org.clojure/test.check "0.9.0"] @@ -58,11 +58,11 @@ "-Dclojure.compiler.direct-linking=true"] :test-paths ["perf-test/clj"] :dependencies [[compojure "1.6.0"] - [org.immutant/immutant "2.1.9"] + [org.immutant/immutant "2.1.10"] [io.pedestal/pedestal.route "0.5.3"] - [org.clojure/core.async "0.3.465"] + [org.clojure/core.async "0.4.474"] [ataraxy "0.4.0"] - [bidi "2.1.2"]]} + [bidi "2.1.3"]]} :analyze {:jvm-opts ^:replace ["-server" "-Dclojure.compiler.direct-linking=true" "-XX:+PrintCompilation"