dependency

Function used to declare a dependency to a path and delegate access to its value within a ValidationContext.

If the dependency could not be found in the form during the execution of the validation, then accessing this dependency will throw DependencyNotFoundException.

It should be used as follows:

private val ValidationContext.dependencyKey: Type by dependency(path)

Validation dependency paths may contain a single recursive wildcard at the end, indicating that the validation should be reevaluated by the form manager whenever a child value of the dependency changes. Otherwise, a dependency must contain no wildcards.