Releases: konform-kt/konform
Releases · konform-kt/konform
v0.10.0: Dynamic context
This release adds one of the longer-requested features: cross-field validations and validation based on context.
This is achieved with the new dynamic
function, see the README for usage.
- Add dynamic and cross-field validations
- Allow customizing hint in required
- Give deprecation warning if ifPresent or required are used on non-nullable properties
v0.9.2
- open up
ValidationBuilder
for extensions, see ExtendingValidationBuilderTest.kt for an example - Make
ValidationResult.prependPath
public
v0.9.1
- Allow ValidationPath in validate() and ValidationPath.of
v0.9.0 ValidationPath and userContext
Features:
- Add
ValidationResult.errors
containingValidationError
with aValidationPath
to safely inspect and use validation error and paths - Add
constrain()
in ValidationBuilder as a replacement foraddConstraint
, directly allowingpath
anduserContext
to be set - Add
path()
in ValidationBuilder to adjust the reported validation path of a validation error - Add
userContext()
in ValidationBuilder to add any data to the reported validation error - Add various utilities to
Validation
andValidationResult
, or lists of them
Deprecations and breaking changes:
- Move constraints from
io.konform.validation.jsonschema
toio.konform.validation.constraints
, deprecations can be solved by replacing the import - Remove
ValidationBuilder.has
. Can be replaced by directly adding the validation in the builder - Deprecate
addConstraint()
, useconstrain()
instead. templateValues are not supported therein, directly add them to the hint.
0.8.0: Subclasses
- Makes
Validation
contravariant, allowing aValidation<Animal>
to be used as aValidation<Cat>
(#151 by @dhoepelman) - Adds
ifInstanceOf<T>
andrequireInstanceOf<T>
validations, running a validation only if the value is of a specific subclass (ifInstanceOf) or returning invalid when it's of a different subclassrequireInstanceOf
(#152 by @dhoepelman )
0.7.0: Custom validations
- Enhances custom validations by adding
validate
and overloadingrequired
andifPresent
to transform data before doing the validation, see the "custom validations" section of the README (#65 by @NikkyAI and @dhoepelman) - Adds support for adding validations on zero-argument functions, which is especially useful for Java getters (#65 by @NikkyAI)
0.6.2: Kotlin/Native targets
- Add remaining Kotlin/Native targets, fixing #124 (#125 by @dhoepelman)
0.6.1: Kotlin/Native macOS
0.6.0: Kotlin 2.0, Kotlin/Native, Kotlin/Wasm
- Upgrade to Kotlin 2.0. Minimum user version is still 1.7 (#106 by @jillesvangurp)
- Adds Kotlin/Native (#103 by @jillesvangurp)
- Adds Kotlin/Wasm (#103 by @jillesvangurp)
- Add
ValidationResult<T>.isValid
(#113 by @jillesvangurp)
0.5.0: We're back baby
- Upgrade to Kotlin 1.9, requiring Kotlin 1.7+ to use this library
- Make
ValidationResult
covariant (#56 by @nlochschmidt , #94 by @dhoepelman ) - Add
ifPresent
andrequired
validations for nullable types (#56 by @nlochschmidt ) - Deprecate
ValidationErrors
in favor ofList<ValidationError>
(#95 by @dhoepelman ) - Add
uuid()
validation for Strings (#49 by @vitorfec)