Swagger Spec for Clojure Web Apps
ring.swagger.validator/validate
.(require '[ring.swagger.validator :as v])
(v/validate (rs/swagger-json {:paths {"/api/ping" {:get nil}}}))
; nil
(v/validate (rs/swagger-json {:pathz {"/api/ping" {:get nil}}}))
; ({:level "error"
; :schema {:loadingURI "#", :pointer ""}
; :instance {:pointer ""}
; :domain "validation"
; :keyword "additionalProperties"
; :message "object instance has properties which are not allowed by the schema: [\"pathz\"]", :unwanted ["pathz"]})
s/Keyword
were supported.nil
default value (#79)[prismatic/schema "1.0.4"] is available but we use "1.0.3"
[potemkin "0.4.3"] is available but we use "0.4.1"
swagger-ui
now supports passing arbitrary options to SwaggerUI
[metosin/schema-tools "0.7.0"] is available but we use "0.5.2"
[prismatic/schema "1.0.3"] is available but we use "0.4.4"
[prismatic/plumbing "0.5.1"] is available but we use "0.4.4"
ring.swagger.json-schema/json-type
multimethod is removed
ring.swagger.json-schema/convert-class
multimethod, taking both the class and swagger optionsring.swagger.json-schema/JsonSchema
protocol.ring.swagger.json-schema
:
->json
is now ->swagger
and takes options map instead of kwargs.:top
(required only for Swagger 1.2):in
denote the parameter type (:query
, :header
, :path
, :formData
or :body
)
:in
.{:query {:x [Long]}}
with ring.middleware.params/wrap-params
middleware and query-string of
x=1&x=2&x?3
with ring.swagger.schema/coercer!
should result in x
being [1 2 3]
:query-params [x :- [Long]]
multi
.ring.swagger.upload/TempFileUpload
and ByteArrayUpload
Schemas to be used
with ring.middleware.multipart-params
default stores.schema.core.One
by Steffen Dienst.:version
is not mandatory field in ring-swagger schema (defaults to 0.0.1
)ring.swagger.swagger2
:
transform-operations
for generic operation transformations on the client sideensure-body-and-response-schema-names
to fix the generated schema names on the client side (vs. the swagger-json
generating new names for all the requests.:paths
order is now preserved
flatland.ordered.map/ordered-map
in the client side to keep the order.[metosin/schema-tools "0.5.2"] is available but we use "0.4.1"
[metosin/ring-http-response "0.6.5"] is available but we use "0.6.2"
[metosin/ring-swagger-ui "2.1.2"] is available but we use "2.0.24"
[prismatic/schema "0.4.4"] is available but we use "0.4.3"
[cheshire "5.5.0"] is available but we use "5.4.0"
[org.flatland/ordered "1.5.3"] is available but we use "1.5.2"
[clj-time "0.11.0"] is available but we use "0.9.0"
[potemkin "0.4.1"] is available but we use "0.3.13"
[lein-ring "0.9.6"] is available but we use "0.9.4"
[funcool/codeina "0.3.0"] is available but we use "0.1.0"
[midje "1.7.0"] is available but we use "1.7.0-SNAPSHOT"
ring.swagger.swagger2/transform-paths
for generic endpoint tranformations.[metosin/schema-tools "0.4.1"] is available but we use "0.4.0"
[metosin/ring-http-response "0.6.2"] is available but we use "0.6.1"
[prismatic/schema "0.4.3"] is available but we use "0.4.2"
[prismatic/plumbing "0.4.4"] is available but we use "0.4.3"
[instar "1.0.10" :exclusions [org.clojure/clojure com.keminglabs/cljx org.clojure/clojurescript]]]
:handle-duplicate-schemas-fn
to handle duplicates schemas.
IllegalArgumentException
(the code was broken, did not work with anonymous predicate schemas & regexps.[prismatic/plumbing "0.4.3"] is available but we use "0.4.2"
[lein-ring "0.9.4"] is available but we use "0.9.3"
:type "object"
to Swagger 2.0 Definitions, requested by Ron.set-swagger-data
, reading data via get-swagger-data
.wrap-swagger-data
middleware for easy publishing of swagger-data.[prismatic/schema "0.4.2"] is available but we use "0.4.1"
swagger-json
now handles nil
options, thanks to Frankie Sardo.[prismatic/schema "0.4.1"] is available but we use "0.4.0"
Info
schema in ring.swagger.swagger2-schema
!swagger-json
are deep-merged in instead of plain merge./api/api-docs
to /swagger.json
in `ring.swagger.ui