JamesRandall / AccidentalFish.FSharp.Validation

Simple validator DSL / library for F#
MIT License
89 stars 10 forks source link

Bubbling validation errors from nested validators #3

Open vsviridov opened 3 years ago

vsviridov commented 3 years ago

Currently if a nested validator (created using withValidator or eachItemWith, etc... fires - it only reports the property name as it knows it so for some object like

{
  a: {
    Id: ""
    b: {
      Id: ""
      c: {
        Id: ""
      }
   }
}

it will report Id is empty (or equivalent), so for complex objects it is difficult to figure out that it was a.b.c.Id that was empty and not some other one.

What would be a good way to fix this?