Skip to content

Releases: metosin/ring-swagger

0.22.3

17 Jan 18:46
0.22.3
Compare
Choose a tag to compare

compare

  • 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

17 Jan 18:45
Compare
Choose a tag to compare

compare

  • Discard all extra map keys from properties (#77)
  • All Schema extra keys
    are now exposed as Swagger additional properties.
    • Previously only s/Keyword were supported.
  • Fix JSON Schema nil default 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

17 Jan 18:45
Compare
Choose a tag to compare

compare

  • Generate (s/maybe s/Str)-parameters of s/Any for non-body-parameters. Fixes #74.
  • Mappings for s/Symbol & s/Inst
  • Use :default metadata of optional-keys set by Plumbing for Swagger
    property default field.
[prismatic/plumbing "0.5.2] is available but we use "0.5.1"

0.22.0

08 Nov 10:22
Compare
Choose a tag to compare

compare

  • 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 to SwaggerUI
  • 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

08 Nov 10:22
Compare
Choose a tag to compare

compare

Breaking changes

  • BREAKING: Swagger 1.2 is no more supported.
  • BREAKING: ring.swagger.json-schema/json-type multimethod 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-class multimethod, taking both the class and swagger options
      • Objects (e.g. records) via ring.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.
    • removed option :top (required only for Swagger 1.2)
    • new option :in denote the parameter type (:query, :header, :path, :formData or :body)
      • responses don't have :in.

New features

  • Support for collections in query and form parameters (even with single parameter):
    • Parameters {: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]
      • Same with Compojure-api: :query-params [x :- [Long]]
    • For now, only supports collectionFormat
      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 side
    • ensure-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
    • use 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"
  • 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

26 May 11:18
Compare
Choose a tag to compare
  • ring.swagger.swagger2/transform-paths for 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

26 May 11:18
Compare
Choose a tag to compare
  • new option :handle-duplicate-schemas-fn to 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.
  • 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

26 May 11:18
Compare
Choose a tag to compare
  • 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 via get-swagger-data.
    • wrap-swagger-data middleware for easy publishing of swagger-data.
  • updated dependencies:
[prismatic/schema "0.4.2"] is available but we use "0.4.1"

0.20.1

26 May 11:17
Compare
Choose a tag to compare
  • swagger-json now handles nil options, thanks to Frankie Sardo.
  • updated dependencies:
[prismatic/schema "0.4.1"] is available but we use "0.4.0"

0.20.0

26 May 11:17
Compare
Choose a tag to compare
  • welcome back the Info schema in ring.swagger.swagger2-schema!
  • ring-swagger defaults in swagger-json are deep-merged in instead of plain merge.
  • breaking: default spec-location has changed from /api/api-docs to /swagger.json in `ring.swagger.ui