Open AWinterman opened 4 years ago
What do you mean by "map that check to a wire representation".
Could you provide a minimal example of the DSL/API you'd like to see?
if the errors object simply had a reference to the properties that are erroring, that would be sufficient. Maybe a linked list of the properties that make up the path?
Currently, there is no way to programatically list all the errors associated with an object.
Yes, you can call
ValidationResult.errors
but thedataPath
is computed in a non-public method, and there's no way to map it back to the property that errored without duplicated the computation.Essentially I would like to do the following:
The
Validation.dataPath
method is a serialized representaiton of the error. I need a kotlin one.I can almost get there simply by passing around references to the object properties (which has its own problems), but the handling for arrays puts it over the edge of inconvenience.