s/eq
is mapped into enum by Joel Kaasinen.
Updated deps:
[cheshire "5.8.1"] is available but we use "5.8.0"
[metosin/ring-http-response "0.9.1"] is available but we use "0.9.0"
[ring/ring-core "1.7.1"] is available but we use "1.6.3"
[metosin/schema-tools "0.11.0"] is available but we use "0.10.3"
[prismatic/schema "1.1.10"] is available but we use "1.1.9"
[metosin/scjsv "0.5.0"] is available but we use "0.4.1"
[clj-time "0.15.1"] is available but we use "0.14.4"
Updated dependencies:
[metosin/schema-tools "0.10.3"] is available but we use "0.9.1"
[prismatic/schema "1.1.9"] is available but we use "1.1.7"
[clj-time "0.14.4"] is available but we use "0.14.2"
[potemkin "0.4.5"] is available but we use "0.4.4"
[frankiesardo/linked "1.3.0"] is available but we use "1.2.9"
BREAKING: drop automatic (potemkin) imports of ring.middleware.multipart-params
from ring.swagger.upload
to support non-servlet servers. You can require those manually.
Updated deps
[metosin/scjsv "0.4.1"] is available but we use "0.4.0"
[prismatic/plumbing "0.5.5"] is available but we use "0.5.4"
[ring/ring-core "1.6.3"] is available but we use "1.6.2"
[clj-time "0.14.2"] is available but we use "0.14.0"
:x-oneOf
and :x-oneOf
instead of :oneOf
& :anyOf
for Swagger2, thanks to Nicolas Ha[metosin/schema-tools "0.9.1"] is available but we use "0.9.0"
[prismatic/schema "1.1.7"] is available but we use "1.1.6"
:description
is read from Schema meta-data into response bodys too. Thanks to David James Humphreys{:get {:parameters {:query {:kikka/kukka String}}
:responses {200 (rsjs/describe
{:body {:kikka/kukka String}}
"A meta description")}}}
(require '[ring.swagger.coerce :as coerce])
(import org.joda.money.Money)
(defmethod coerce/custom-matcher org.joda.money.Money [_] #(org.joda.money.Money/parse %))
[cheshire "5.8.0"] is available but we use "5.7.1"
[potemkin "0.4.4"] is available but we use "0.4.3"
Support for s/Num
coercion, thanks to Valtteri Harmainen.
updated dependencies:
[ring/ring-core "1.6.2"] is available but we use "1.6.0"
[prismatic/schema "1.1.6"] is available but we use "1.1.5"
[clj-time "0.14.0"] is available but we use "0.13.0"
Drop [slingshot "0.12.2"]
dependency, use ex-info
instead.
Support qualified keywords in swagger parameters, fixes #93
Depend directly on [ring/ring-core "1.6.0"]
updated dependencies:
[ring/ring-core "1.6.0"] is available but we use "1.6.0-beta7"
[cheshire "5.7.1"] is available but we use "5.7.0"
[prismatic/plumbing "0.5.4"] is available but we use "0.5.3"
[prismatic/schema "1.1.5"] is available but we use "1.1.3"
[metosin/ring-http-response "0.9.0"] is available but we use "0.8.2"
[metosin/ring-swagger-ui "2.2.10"] is available but we use "2.2.8"
ring.swagger.ui
is now ring.swagger.swagger-ui
with new map-based options:
swagger-ui
takes just a single options map instead of varargs with new key path
for the path to be mountedwrap-swagger-ui
takes just a single options map (with path
) instead of varargs(require '[ring.swagger.swagger-ui :as ui])
(ui/swagger-ui {:path "/api-docs"})
(-> app (ui/wrap-swagger-ui {:path "/api-docs"}))
Support async-ring in ring.swagger.middleware
Support for java.io.File
return type, mapping to "file"
Use ex-info
& ex-data
instead of Slingshot in exceptions
updated dependencies:
[cheshire "5.7.0"] is available but we use "5.6.3"
[metosin/ring-http-response "0.8.2"] is available but we use "0.8.1"
[slingshot "0.12.2"]
[metosin/ring-http-response "0.8.1"] is available but we use "0.8.0"
[clj-time "0.13.0"] is available but we use "0.12.1"
[metosin/scjsv "0.4.0"] is available but we use "0.3.0"
[clj-time "0.12.1"] is available but we use "0.12.0"
[frankiesardo/linked "1.2.9"] is available but we use "1.2.8"
[frankiesardo/linked "1.2.8"] is available but we use "1.2.7"
schema.core/defrecords
, fixes #103.:body
& :response
.
org.joda.time.LocalTime
, thanks to Francesco Bellomi!s/Any
as a value generates empty object {}
to JSON Schema, Fixes #91, thanks to Mika Haapakorpi for the tip.[cheshire "5.6.3"] is available but we use "5.6.1"
[metosin/ring-http-response "0.8.0"] is available but we use "0.7.0"
[metosin/scjsv "0.3.0"] is available but we use "0.2.0"
[prismatic/schema "1.1.3"] is available but we use "1.1.2"
[frankiesardo/linked "1.2.7"] is available but we use "1.2.6"
$ref
of it, fixes #96.ring.swagger.json-schema/field
:(s/defschema Required
(rsjs/field
{:name s/Str
:title s/Str
:address (rsjs/field
(rsjs/field s/Str {:description "description here"})
{:description "Streename"
:example "Ankkalinna 1"})}
{:minProperties 1
:description "I'm required"
:example {:name "Iines"
:title "Ankka"}}))
Better support for nillable fields via x-nullable
standard hack, fixes fixes #97
updated dependencies:
[metosin/ring-http-response "0.7.0"] is available but we use "0.6.5"
[prismatic/schema "1.1.2"] is available but we use "1.1.1"
[clj-time "0.12.0"] is available but we use "0.11.0"
Response headers are mapped correctly, Fixes https://github.com/metosin/compojure-api/issues/232.
updated dependencies:
[prismatic/schema "1.1.1"] is available but we use "1.1.0"
ring.swagger.core/with-named-subschemas
retains metadata, fixes https://github.com/metosin/compojure-api/issues/168[prismatic/schema "1.1.0"] is available but we use "1.0.5"
[cheshire "5.6.1"] is available but we use "5.5.0"
[prismatic/plumbing "0.5.3"] is available but we use "0.5.2"
[metosin/schema-tools "0.9.0"] is available but we use "0.8.0"
Use strings instead of keywords in :in
, fixes #88, thanks to https://github.com/preoctopus for the fix.
experimental ring.swagger.swagger2-full-schema/Swagger
for validating the ring-swagger spec in Clojure
updated dependencies:
[prismatic/schema "1.0.5"] is available but we use "1.0.4"
[metosin/schema-tools "0.8.0"] is available but we use "0.7.0"
s/find-extra-keys-schema
returning nil) will have :additionalProperties
set to false
.schema.core.Maybe
ring.swagger.coerce/query-coercions
now apply both :json
and :query
coercions for s/Int
, Long
and Double
ring.swagger.swagger2/transform
-> ring.swagger.json-schema/schema-object
Fixed generating Swagger path templates in cases where path parameter is followed by an extension (#82)
Make the JSON Schema validator public: 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"
(s/maybe s/Str)
-parameters of s/Any
for non-body-parameters. Fixes #74.s/Symbol
& s/Inst
:default
metadata of optional-key
s set by Plumbing for Swagger
property default
field.[prismatic/plumbing "0.5.2] is available but we use "0.5.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"
BREAKING: Swagger 1.2 is no more supported.
BREAKING: 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.lot's of internal cleanup in 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
.Support for collections in query and form parameters (even with single parameter):
{: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
.(From compojure-api) Support for file uploads.
ring.swagger.upload/TempFileUpload
and ByteArrayUpload
Schemas to be used
with ring.middleware.multipart-params
default stores.support for schema.core.One
by Steffen Dienst.
:version
is not mandatory field in ring-swagger schema (defaults to 0.0.1
)
new public api fns in 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.Fixes 54: :paths
order is now preserved
flatland.ordered.map/ordered-map
in the client side to keep the order.updated dependencies:
[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.uiadditionalProperties
via s/Keyword
-key in the schemas. Thanks for Juan Patten for the initial code.IllegalArgumentException
if multiple different schemas have a same name. Fixes #39javax.servlet ServletContext
, causing reflection on Servlet Apps.[prismatic/plumbing "0.4.2"] is available but we use "0.4.1"
[metosin/schema-tools "0.4.0"] is available but we use "0.3.0"
ring/swagger/v2.0_schema.json
[metosin/scjsv "0.2.0"] is available
:resourcePath
is now set correctly with Swagger 1.2 endpoints (fixes #36.with-named-sub-schemas
takes an optional parameter - prefix for schema names[metosin/schema-tools "0.3.0]
to walk over Schema records both to fetch schema names and give names to subschemas (Swagger 2.0 only)
[lein-ring "0.9.3"] is available but we use "0.9.2"
with-named-sub-schemas
has learned how to add names to schemas inside s/maybe
and others
s/maybe
[prismatic/schema "0.4.0"] is available but we use "0.3.7"
[prismatic/plumbing "0.4.1"] is available but we use "0.3.7"
[potemkin "0.3.12"] is available but we use "0.3.11"
[metosin/ring-http-response "0.6.1"] is available but we use "0.6.0"
ring.swagger.swagger2/swagger-json
now takes an optional extra argument, the Options-map
with options :ignore-missing-mappings?
& :default-response-description-fn
s/either
from ring.swagger.json-schema-dirty
to ring.swagger.json-schema
.
Uses the first schema element as the source for the mappingsring.swagger.middleware/wrap-validation-error
takes now options as a single map[metosin/ring-http-status "0.6.0"] is available but we use "0.5.2"
[prismatic/schema "0.3.7"] is available but we use "0.3.3"
[prismatic/plumbing "0.3.7"] is available but we use "0.3.5"
[lein-ring "0.9.2"] is available but we use "0.9.1"
/api/docs
to be more backwards compatible. Swagger2-clients should use swagger.json
.ring.swagger.middleware/comp-mw
to make middleware parametrization easier:(def wrap-swagger2-ui
(comp-mw wrap-swagger-ui :swagger-docs "swagger.json"))
ring.swagger.swagger2
with clean public API with Schemas/api/docs
to /swagger.json
(2.0 standard)ring.swagger.middleware
the catch-validation-error
is now wrap-validation-error
:error-handler
to allow error response customization & :catch-core-errors?
for
catching :schema.core/error
s (defaults to false
).coerce
and coerce!
ring.swagger.validator
)java.util.regex Pattern
/ s/Regex
(as a class)#"^[a-9]$"
(as a instance)authorization
parameters by Dmitry Groshev[cheshire "5.4.0"] is available but we use "5.3.1"
[clj-time "0.9.0"] is available but we use "0.8.0"
*[metosin/ring-swagger-ui "2.0.24"] is available but we use "2.0.17"
*[com.github.fge/json-schema-validator "2.2.6"] is available but we use "2.2.5"
*[lein-ring "0.9.1"] is available but we use "0.8.13"
[instar "1.0.10"]
ring.swagger.json-schema/*ignore-missing-mappings*
to true will cause unknown json-schema mappings to be ignored[metosin/ring-http-response "0.5.2"] is available but we use "0.5.1"
[prismatic/schema "0.3.3"] is available but we use "0.3.2"
[ring/ring-core "1.3.2"] is available but we use "1.3.1"
s/Named
[org.tobereplaced/lettercase "1.0.0"]
in favour of [camel-snake-kebab "0.2.5"]
[prismatic/schema "0.3.2"] is available but we use "0.3.1"
java.lang.Number
, java.lang.Integer
, s/Num
[slingshot "0.12.1"] is available but we use "0.12.0"
[metosin/ring-http-response "0.5.1"] is available but we use "0.5.0"
[prismatic/plumbing "0.3.5"] is available but we use "0.3.4"
[camel-snake-kebab "0.2.5"] is available but we use "0.2.4"
[potemkin "0.3.11"] is available but we use "0.3.10"
[lein-ring "0.8.13"] is available but we use "0.8.11"
[prismatic/schema "0.3.1"] is available but we use "0.2.6"
camel-snake-kebab
to camel-snake-kebab.core
ring.swagger.json-schema-dirty
namespace now provides experimental
implementation for s/if
, s/conditional
and s/either
Schema transformations.s/recursive
ordered-map
ordered-map
from flatland.ordered.map(s/defschema (ordered-map :a String ...))
ring.swagger.schema/defmodel
, please use schema.core/defschema
.json-schema
module.describe
helper:
(field Long {:description "The description"})
you can use(describe Long "The description")
ring.swagger.ui/swagger-ui
always set content-type of application/javascript
for conf.js
ring.swagger.ui/wrap-swagger-ui
to package swagger-ui as middleware.[prismatic/plumbing "0.3.3"] is available but we use "0.3.2"
[metosin/ring-swagger-ui "2.0.17"] is available but we use "2.0.16-3"
2 artifacts were upgraded.
s/Uuid
, thanks to @phadej!header
-params.s/defn
to `sm/defn, might fix #12 (https://github.com/Prismatic/schema/issues/21)s/Keyword
s.[prismatic/schema "0.2.4"] is available but we use "0.2.3"
[prismatic/plumbing "0.3.2"] is available but we use "0.3.1"
[lein-ring "0.8.11"] is available but we use "0.8.10"
s/Any
(maps to void
as a return type, fields of this type are ignored)s/Keyword
(or any other schema.core.Predicate
) as a key -> fields are ignored0.9.0
failed to clojarsdefmodel
with nested anonymous submodels works now with AOTdefmodel
doesn't contain the model
metadata -> removed all the model var-resolutionsschema.core/defschema
s as the modelsdefmodel
now supports anonymous maps within valid containers (set
,list
,vector
)(require '[ring.swagger.schema :refer :all])
(require '[ring.swagger.core :refer [transform]])
(defmodel Items {:data [{:id Long
:name String}]})
Items
;; {:data [{:name java.lang.String, :id java.lang.Long}]}
ItemsData
;; {:name java.lang.String, :id java.lang.Long}
(transform Items)
;; {:properties {:data {:items {:$ref "ItemsData"}, :type "array"}}, :required [:data]}
(transform ItemsData)
;; {:properties {:name {:type "string"}, :id {:type "integer", :format "int64"}}, :required [:name :id]}
lein check
suggestedring.swagger.ui
-ns provided swagger-ui
function which can be used to create ring handler to serve Swagger-ui.consumes
and produces
can be set by the client side for the api declaration.strict-schema
and loose-schema
extract-basepath
renamed to basepath
, understands the :servlet-context
and header x-forwarded-proto
string-path-parameters
(string-path-parameters url)
to create those automaticallys/eq
nil
type-of
and return-type-of
are removed in favour of ->json
./api/users/:id
) instead of a Vector (["/api/users/" :id]
)resolve-model-vars
uses Walking to preserve the original collection form (Sets)return-type-of
preserves Sets.s/recursive
), thanks to Arttu Kaipiainen!:json
and :query
, latter converts strings to Longs, Doubles and Booleans_
to split up classes. Customer_Address
-> CustomerAddress
. Looks good.defmodel
now supports nested maps (by generating sub-types)(defmodel Customer {:id String
:address {:street String
:zip Long
:country {:code Long
:name String}}})
;; Customer => {:id java.lang.String, :address {:street java.lang.String, :zip java.lang.Long, :country {:name java.lang.String, :code java.lang.Long}}}
;; Customer_Address => {:street java.lang.String, :zip java.lang.Long, :country {:name java.lang.String, :code java.lang.Long}}
;; Customer_Address_Country => {:name java.lang.String, :code java.lang.Long}
s/maybe
and s/both
Date
& DateTime
both with and without millis: "2014-02-18T18:25:37.456Z"
& "2014-02-18T18:25:37Z"
org.joda.time.LocalDate
java.util.Date
and org.joda.time.DateTime
Can you improve this documentation? These fine people already did:
Tommi Reiman, Juho Teperi, Ambrose Bonnaire-Sergeant & Miikka KoskinenEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close