Skip to content

Releases: konform-kt/konform

v0.10.0: Dynamic context

17 Nov 21:54
v0.10.0
2b0217e
Compare
Choose a tag to compare

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

15 Nov 14:46
15b871b
Compare
Choose a tag to compare

v0.9.1

14 Nov 19:52
6ec40a4
Compare
Choose a tag to compare
  • Allow ValidationPath in validate() and ValidationPath.of

v0.9.0 ValidationPath and userContext

13 Nov 22:09
6cff5e6
Compare
Choose a tag to compare

Features:

  • Add ValidationResult.errors containing ValidationError with a ValidationPath to safely inspect and use validation error and paths
  • Add constrain() in ValidationBuilder as a replacement for addConstraint, directly allowing path and userContext 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 and ValidationResult, or lists of them

Deprecations and breaking changes:

  • Move constraints from io.konform.validation.jsonschema to io.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(), use constrain() instead. templateValues are not supported therein, directly add them to the hint.

0.8.0: Subclasses

01 Nov 07:20
af642ab
Compare
Choose a tag to compare
  • Makes Validation contravariant, allowing a Validation<Animal> to be used as a Validation<Cat> (#151 by @dhoepelman)
  • Adds ifInstanceOf<T> and requireInstanceOf<T> validations, running a validation only if the value is of a specific subclass (ifInstanceOf) or returning invalid when it's of a different subclass requireInstanceOf (#152 by @dhoepelman )

0.7.0: Custom validations

17 Sep 11:17
1cdd3b9
Compare
Choose a tag to compare
  • Enhances custom validations by adding validate and overloading required and ifPresent 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

04 Sep 20:09
420cd2a
Compare
Choose a tag to compare

0.6.1: Kotlin/Native macOS

07 Jul 13:43
3556e95
Compare
Choose a tag to compare
  • Adds release artifacts for Kotlin/Native macOS, which weren't included in 0.6.0 (#119 by @psuzn)

0.6.0: Kotlin 2.0, Kotlin/Native, Kotlin/Wasm

02 Jun 11:34
285db7e
Compare
Choose a tag to compare

0.5.0: We're back baby

10 May 18:23
e586806
Compare
Choose a tag to compare
  • Upgrade to Kotlin 1.9, requiring Kotlin 1.7+ to use this library
  • Make ValidationResult covariant (#56 by @nlochschmidt , #94 by @dhoepelman )
  • Add ifPresent and required validations for nullable types (#56 by @nlochschmidt )
  • Deprecate ValidationErrors in favor of List<ValidationError> (#95 by @dhoepelman )
  • Add uuid() validation for Strings (#49 by @vitorfec)