We use Break Versioning. The version numbers follow a <major>.<minor>.<patch> scheme with the following intent:
| Bump | Intent |
|---|---|
major | Major breaking changes -- check the changelog for details. |
minor | Minor breaking changes -- check the changelog for details. |
patch | No breaking changes, ever!! |
-SNAPSHOT versions are preview versions for upcoming releases.
:description and :openapi/description get used for populating the OpenAPI parameter :description.
#84
metosin/reitit#612:swagger/* and :openapi/* contributing to swagger/openapi schemas, you can override the whole swagger/openapi schema with :swagger or :openapi:(require '[schema.core :as s])
(require '[schema-tools.core :as st])
(require '[schema-tools.openapi.core :as openapi])
(openapi/transform (st/schema {:foo s/Num}
{:openapi {:type "string" :format "binary"}})
{})
;; {:type "string", :format "binary"}
[prismatic/schema "1.1.12"] is available but we use "1.1.11"
(stc/coerce
{:1 {:true "1", :false "2"}}
{s/Int {s/Bool s/Any}}
stc/json-coercion-matcher)
; {1 {true "1", false "2"}}
swagger namespace in st/schema data contribute to Swagger Schema:(require '[schema.core :as st])
(require '[schema-tools.core :as st])
(require '[schema-tools.swagger.core :as swagger])
(swagger/transform
(st/schema
s/Str
{:swagger/default "abba"
:swagger/format "email"}))
; {:type "string"
; :format "email"
; :default "abba"}
[prismatic/schema "1.1.11"] is available but we use "1.1.9"
open-schema now uses s/Keyword as open key Schema, instead of s/Anyschema-tools.coerce/default-key-matcher which adds missing map keys if they have default values specified.schema-tools.coerce/default-coercion-matcher has been renamed to stc/default-value-matcher.
default-coercion-matcher is now a deprecated alias for default-value-matcher.schema-tools.coerce/default-matcher combines the effects of default-key-matcher and default-value-matcher.js/RegExp as Schema is no longer supported, instead one should use schema.core/Regexschema-tools.core/optional-keys-schema to make all Map Schema keys optional (recursively)walkjava.time)Default record value is now value, not default, fixes #34schema-tools.coercion contains now json-coercion-matcher and string-coercion-matcher, ported and polished from Ring-swaggerstc/corce and stc/coercer default to (constantly nil) matcherst/open-schema transforms all nested Map Schemas to accept any extra keys[org.clojure/clojurescript "1.9.946"] & [org.clojure/clojure "1.9.0-beta2"][prismatic/schema "1.1.7"] is available but we use "1.0.5"
[org.clojure/clojurescript "1.9.946"] is available but we use "1.9.562"
schema-tools.walk/walk argument order has been changed to match
clojure.walk/walkpostwalk and prewalk to schema-tools.walkselect-schema migration helper has been dropped off(st/default Long 1)& stc/default-coercion-matcherstc/multi-matcher for applying multiple coercions for same schemas & values[prismatic/schema "1.0.5"] is available but we use "1.0.3"
walk losing metadata for IMapEntries (or vectors) on
Clojure 1.8[prismatic/schema "1.0.3"] is available but we use "1.0.2"
schema-tools.walk
s/constrained[prismatic/schema "1.0.2"] is available but we use "1.0.1"
walk for ConditionalSchemaschema-tools.walk
Conditional and CondPre schemes.inner is not called for them as they don't have sub-schemas.schema-tools.experimental.walk which provides support for
schema.experimental.abstract-map[prismatic/schema "1.0.1"] is available but we use "0.4.4"
select-schema WARNING on ClojureScript.[prismatic/schema "0.4.4"] is available but we use "0.4.3"
[org.clojure/clojurescript "1.7.107"] is available but we use "1.7.28"
schema-tools.coerce (idea by Michael Griffiths & ring-swagger)
coercer to create a coercer, which throws exception if the value can't be coerced to match the schema.coerce to create and apply a coercer, which throws exception if the value can't be coerced to match the schema.:type can overridden, defaulting to :schema-tools.coerce/errorsafe-coercermap-filter-matcher to strip illegal keys from non-record maps
select-schema signature and functionality has changed
[schema value] -> [value schema][matcher schema value] -> [value schema matcher]"Illegal argument order - breaking change in 0.5.0." if second argument is not a schemamap-filter-matcher) to drop illegal keys
schema.core/validate(st/select-schema
{:a "a"
:z "disallowed key"
:b "disallowed key"
:x-kikka "x-kikka"
:x-kukka "x-kukka"
:y-kikka "invalid key"}
{(s/pred #(re-find #"x-" (name %)) ":x-.*") s/Any, :a String})
; {:a "a", :x-kikka "x-kikka", :x-kukka "x-kukka"}
(st/select-schema {:beer "ipa" :taste "good"} {:beer (s/enum :ipa :apa)} )
; clojure.lang.ExceptionInfo: Could not coerce value to schema: {:beer (not (#{:ipa :apa} "ipa"))}
; data: {:type :schema.core/error,
; :schema {:beer {:vs #{:ipa :apa}}},
; :value {:beer "ipa", :taste "good"},
; :error {:beer (not (#{:ipa :apa} "ipa"))}}
(require '[schema.coerce :as sc])
(st/select-schema {:beer "ipa" :taste "good"} {:beer (s/enum :ipa :apa)} sc/json-coercion-matcher)
; {:beer :ipa}
select-schema takes now optional coercion matcher - to coerce values safely in a single sweepor-matcher[prismatic/schema "0.4.3"] is available but we use "0.4.2"
[org.clojure/clojurescript "0.0-3297"] is available but we use "0.0-3269"
schema-with-description schema-description, resolve-schema (clj only), resolve-schema-description (clj only)[prismatic/schema "0.4.2"] is available but we use "0.4.0"
[codox "0.8.12"] is available but we use "0.8.11"
[org.clojure/clojurescript "0.0-3269"] is available but we use "0.0-3196"
assoc:name) if the transforming functions have changed the schema.
assoc, dissoc, select-keys, assoc-in, update-in, dissoc-in, update, merge, optional-keys, required-keysschema-tools.walk namespace
clojure.walk/walk like walk function which knows how to
traverse through Schemas.[prismatic/schema "0.4.0"]with-optional-keys and with-required-keys are renamed to optional-keys and required-keys and take vector now of keys instead of vararg keysmerge, update[prismatic/schema "0.3.6"] is available but we use "0.3.3"
[org.clojure/clojurescript "0.0-2740"] is available but we use "0.0-2665"
Object on Cljs.Can you improve this documentation? These fine people already did:
Tommi Reiman, Juho Teperi, Miikka Koskinen & Joel KaasinenEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |