Releases: metosin/ring-swagger
Releases · metosin/ring-swagger
0.22.3
- 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"]})0.22.2
- Discard all extra map keys from properties (#77)
- All Schema extra keys
are now exposed as Swagger additional properties.- Previously only
s/Keywordwere supported.
- Previously only
- Fix JSON Schema
nildefault value (#79) - Updated dependencies:
[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"0.22.1
0.22.0
- BREAKING: Dropped support for Clojure 1.6
- BREAKING: Supports and depends on Schema 1.0.
- Uses now linked instead of
ordered for maps where order matters - Fixed #64, use first
found schema name to be consistent with Json Schema. - Fixed #67
swagger-ui
now supports passing arbitrary options toSwaggerUI - updated dependencies:
[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"0.21.0
Breaking changes
- BREAKING: Swagger 1.2 is no more supported.
- BREAKING:
ring.swagger.json-schema/json-typemultimethod is removed- will cause compile-time errors for those who have client-side custom extensions
- new way of doing the Schema -> Swagger Schema mappings:
- Classes via
ring.swagger.json-schema/convert-classmultimethod, taking both the class and swagger options - Objects (e.g. records) via
ring.swagger.json-schema/JsonSchemaprotocol.
- Classes via
- lot's of internal cleanup in
ring.swagger.json-schema:->jsonis now->swaggerand takes options map instead of kwargs.- removed option
:top(required only for Swagger 1.2) - new option
:indenote the parameter type (:query,:header,:path,:formDataor:body)- responses don't have
:in.
- responses don't have
New features
- Support for collections in query and form parameters (even with single parameter):
- Parameters
{:query {:x [Long]}}withring.middleware.params/wrap-paramsmiddleware and query-string of
x=1&x=2&x?3withring.swagger.schema/coercer!should result inxbeing[1 2 3]- Same with Compojure-api:
:query-params [x :- [Long]]
- Same with Compojure-api:
- For now, only supports collectionFormat
multi.
- Parameters
- (From compojure-api) Support for file uploads.
ring.swagger.upload/TempFileUploadandByteArrayUploadSchemas to be used
withring.middleware.multipart-paramsdefault stores.
- support for
schema.core.Oneby Steffen Dienst. :versionis not mandatory field in ring-swagger schema (defaults to0.0.1)- new public api fns in
ring.swagger.swagger2:transform-operationsfor generic operation transformations on the client sideensure-body-and-response-schema-namesto fix the generated schema names on the client side (vs. theswagger-json
generating new names for all the requests.
- Fixes 54:
:pathsorder is now preserved- use
flatland.ordered.map/ordered-mapin the client side to keep the order.
- use
- 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"- dev-dependencies:
[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"0.20.4
ring.swagger.swagger2/transform-pathsfor generic endpoint tranformations.- updated dependencies:
[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"- removed dependency:
[instar "1.0.10" :exclusions [org.clojure/clojure com.keminglabs/cljx org.clojure/clojurescript]]]
0.20.3
- new option
:handle-duplicate-schemas-fnto handle duplicates schemas.- breaking: default behaviour is "take the first definition" instead of
IllegalArgumentException
(the code was broken, did not work with anonymous predicate schemas & regexps.
- breaking: default behaviour is "take the first definition" instead of
- updated deps:
[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"0.20.2
- add
:type "object"to Swagger 2.0 Definitions, requested by Ron. - Middlewares can define extra swagger data, set into a request, read out by swagger-docs
- setting data via
set-swagger-data, reading data viaget-swagger-data. wrap-swagger-datamiddleware for easy publishing of swagger-data.
- setting data via
- updated dependencies:
[prismatic/schema "0.4.2"] is available but we use "0.4.1"0.20.1
swagger-jsonnow handlesniloptions, thanks to Frankie Sardo.- updated dependencies:
[prismatic/schema "0.4.1"] is available but we use "0.4.0"