Skip to content

Commit

Permalink
better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed May 17, 2015
1 parent bc1995d commit de36e71
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ring/swagger/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[ring.swagger.json-schema :as jsons]
[schema-tools.walk :as stw]
[flatland.ordered.set :as os]
[clojure.string :as string]
[org.tobereplaced.lettercase :as lc])
(:import (clojure.lang IMapEntry)))

Expand Down Expand Up @@ -134,12 +135,11 @@
(IllegalArgumentException.
(str
"Looks like you're trying to define two models with the same name ("
schema-name "), but different values:\n\n"
(map (fn [[i v]] (str i ": " v "\n\n")) (zipmap (range) values)) "."
"There is no way to create valid api docs with this setup. Root cause "
" may be that you have defined multiple schemas with same name or you "
"have created copies of the scehmas with clojure.core fn's like "
"\"select-keys\". Please check out schema-tools.core -transformers.")))))
schema-name "), but different values:\n\n" (string/join "\n\n" values) "\n\n"
"There is no way to create valid api docs with this setup. You may have
multiple namespaces defining same Schema names or you have created copies"
"of the scehmas with clojure.core fn's like \"select-keys\". Please check"
"out schema-tools.core -transformers.")))))

(defn handle-duplicate-schemas [f schemas]
(into
Expand Down

0 comments on commit de36e71

Please sign in to comment.