Closed ikitommi closed 1 year ago
Is it possible to not make the change breaking at the moment, but accept both and emit a warning?
thanks @bsless, it is. Changed so that the old syntax works too, just with extra DEPRECATED printing on the console.
Both
m/-simple-schema
andm/-collection-schema
support "content-dependent schema creation", which mean you can use schemaproperties
andchildren
to create the actualSchema
instance. Old mechanism to do this was using a arity2 callback functionchildren properties -> props
instead of actual property map. This is a bad because:IntoSchema
instance. e.g.?props
options
was not passed on to the callbackThis MR introduces a
:compile
options, which is a arity3 functionchildren properties options -> props
. Original properties (without the:compile
) are merged to the result of the:compile
function, so one can define static properties ahead of time an this works now:It's a breaking change for the extender API, marked as
m/-deprecated
so it's easy to migrate to using this.Bump into this while working on https://github.com/metosin/malli/issues/264.
Usage example: