tree-ware / tree-ware-kotlin-core

Apache License 2.0
1 stars 0 forks source link

The set() operator should return errors as aux data in an error model #120

Open deepak-nulu opened 2 years ago

deepak-nulu commented 2 years ago

The errors should be attached to their corresponding nodes in a (sparse) model tree

There are 2 approaches for the implementation:

  1. The set() operator can build the error model as it traverses the set-request model, and trim empty nodes on the way back. This approach creates unnecessary nodes, but can handle missing keys.
  2. When there is an error, the corresponding node is added to the error model. There is no unnecessary node creation with this approach, but it may not be possible to handle missing keys if multiple siblings are missing the same keys (needs to be investigated further).