Skip to content

v0.9.0 ValidationPath and userContext

Compare
Choose a tag to compare
@dhoepelman dhoepelman released this 13 Nov 22:09
· 14 commits to main since this release
6cff5e6

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.