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.
Malli is in alpha.
- Add
ifn?
predicate, #416 - Accumulate errors correctly with
m/-explain
with:function
and:=>
Schemas - New
m/properties-schema
andm/children-schema
to resolve Malli Schemas forIntoSchema
s. Empty implementations. - New
:gen/schema
property for declarative generation, e.g.[:string {:gen/schema :int, :gen/fmap str}]
- Support double generator options via schema properties
- Fix #419: Parsing bug in :map schema
- Fix #418: Better error messages / docs for registry references
- Fix #415: Default branch in multi schema are not transformed
- Fix #427: Generated sets of :ref are always empty
- BREAKING:
-type
is moved fromSchema
toIntoSchema
. - BREAKING:
-type-properties
is moved fromSchema
toIntoSchema
. - new Protocol methods in
IntoSchema
Protocol(-properties-schema [this options] "maybe returns :map schema describing schema properties")
(-children-schema [this options] "maybe returns sequence schema describing schema children")
:nil
schema, #401- BREAKING/FIX: parsing
:multi
returns branch information, #403 :and
merges using first child, #405
- Add
:orn
json-schema & generator, #400 - Ignore optional properties in
mt/default-value-transformer
, #397 - Support
nil
keys in maps, #392 :m/default
for:multi
, #391- Fix inconsistent park-ing in alt(n)-parser, #390
- Fix json schema generation when all attributes of a map are optional, #385
- Note about transformers best-effort behavior, #384
- Humanized regex/sequence errors, #383
- Humanized error for
:double
, #382
-
support for sequence schemas:
:cat
,catn
,alt
,altn
,:?
,:*
,:+
andrepeat
, see Sequence Schemas. -
support for parsing and unparsing schemas:
m/parse
,m/parser
,m/unparse
,m/unparser
, see Parsing values. -
support for function schmas:
:=>
and:function
, see Function Schemas. -
new schemas:
:any
(e.g.any?
),:not
(complement) and:orn
(or with named branches) -
:qualified-keyword
support:namespace
property -
FIX: Schema vizualization is not working for
[:< ...]
like schemas, #370 -
Ensure we use size 30 for generator (for more variety), #364
-
Set JSON Schema types and formats for numbers properly #354
-
-memoize actually memoized. easily 100x faster now #350
-
Fix interceptor composition, #347
-
malli.util
: add a rename-keys utility, similar to clojure.set #338 -
Let
mu/update
accept plain data schemas, #329 -
mu/find
, #322
- BREAKING:
m/Schema
has new methods:-parent
,-parser
and-unparser
- BREAKING:
m/-coder
andm/-chain
are replaced wihm/-intercepting
- BREAKING:
m/-fail!
is nowmiu/-fail!
- BREAKING:
m/-error
is nowmiu/-error
- fix
:sequential
decoding with empty sequence undermt/json-transformer
, fixes #288- removed broken
mt/-sequential->seq
- removed broken
- BREAKING (MINOR):
m/deref
returns original schema, does not throw, fixes #284. - BREAKING (MINOR): the following utilities in
malli.util
deref top-level refs recursively:merge
,union
,transform-entries
,optional-keys
,required-keys
,select-keys
anddissoc
. m/deref-all
derefs all top-level references recursively, e.g.
(m/deref-all [:schema [:schema int?]])
; => int?
:ref
,:schema
,::m/schema
have now generators, JSON Schema and Swagger supportmu/subschemas
walks over top-level:ref
and all:schema
s.m/walk
can walk over:ref
and:schema
reference schemas. Walking can be enabled using options:malli.core/walk-refs
and:malli.core/walk-schema-refs
.- Welcome declarative schema transformations!
There are also declarative versions of schema transforming utilities in malli.util/schemas
. These include :merge
, :union
and :select-keys
:
(def registry (merge (m/default-schemas) (mu/schemas)))
(def Merged
(m/schema
[:merge
[:map [:x :string]]
[:map [:y :int]]]
{:registry registry}))
Merged
;[:merge
; [:map [:x :string]]
; [:map [:y :int]]]
(m/deref Merged)
;[:map
; [:x :string]
; [:y :int]]
(m/validate Merged {:x "kikka", :y 6})
; => true
-
New options for SCI:
:malli.core/disable-sci
for explicitly disablingsci
, fixes #276:malli.core/sci-options
for configuringsci
-
malli.transform/default-value-transformer
accepts options:key
and:defaults
:
(m/decode
[:map
[:user [:map
[:name :string]
[:description {:ui/default "-"} :string]]]]
nil
(mt/default-value-transformer
{:key :ui/default
:defaults {:map (constantly {})
:string (constantly "")}}))
; => {:user {:name "", :description "-"}}
- Support microsecond precision when parsing datetime strings. #280
First stable release.
- 8.10.2020
- removed
:list
schema - removed
malli.error/SchemaError
protocol in favor of usingm/type-properties
for custom errors
- removed
- 20.9.2020
- removed
m/-predicate-schema
,m/-partial-predicate-schema
andm/-leaf-schema
- removed
- 19.9.2020
- new mandatory Protocol method in
m/Schema
:-type-properties
- new mandatory Protocol method in
- 1.9.2020
m/children
returns 3-tuple (key, properties, schema) forMapSchema
sm/map-entries
is removed,m/entries
returns aMapEntry
of key &m/-val-schema
- 4.8.2020
:path
in explain is re-implemented: map keys by value, others by child indexm/-walk
andm/Walker
uses:path
, not:in
m/-outer
has new parameter order:walker schema path children options
malli.util/path-schemas
replaced withmalli.util/subschemas
&malli.util/distict-by
LensSchema
has a new-key
method- renamed some non-user apis in
malli.core
&malli.util
- moved map-syntax helpers from
malli.core
tomalli.util
- dynaload
com.gfredericks/test.chuck
- 23.7.2020
sci
is not a default dependency. Enabling sci-support:- Clojure: add a dependency to
borkdude/sci
- ClojureScript: also require
sci.core
(directly or via:preloads
)
- Clojure: add a dependency to
- 18.7.2020
- big cleanup of
malli.transform
internals.
- big cleanup of
- 12.7.2020
malli.mermaid
is removed (in favor ofmalli.dot
)
- 10.7.2020
[metosin/malli "0.0.1-20200710.075225-19"]
- Visitor is implemented using a Walker.
m/accept
->m/walk
m/schema-visitor
->m/schema-walker
m/map-syntax-visitor
->m/map-syntax-walker
- 31.6.2020
- new
-children
method inSchema
, to return child schemas as instances (instead of just AST)
- new
- 17.6.2020
- change all
malli.core/*-registry
defs intomalli.core/*-schemas
defns to enable DCE for clojurescript
- change all
- 9.6.2020
malli.core/name
&malli.core/-name
renamed tomalli.core/type
&malli.core/-type
malli.generator/-generator
is renamed tomalli.generator/-schema-generator