Closed
Description
We seem to validate nearly everything as if they were groups. Most of our "validateInternal" functions which take a single IScopedNode will instead call the one meant for IEnumerable instead by collecting the single node into an array of 1. This bothers me for multiple reasons.
- We do not know if we are validating a potential recurring element. If the enumerable size is 1, we cannot defer any cardinality assumptions from that, since it could be a recurring element with only 1 item.
- We add indices to the instance path, even when an element is not recurring. This does not make sense to me.
- We create a lot of enumerables of length 1, almost for every element! This seems like a waste of resources.
As an example, I was working on the resource schema when I realised all resources are validated as groups of resources. There is 1 (ONE) case where a field of type resource is recurring, which is "contained". The fact that we group validate single resources led to bugs like #368. We should investigate if we can have a clearer boundary between what is validated as a group and what is validated as a standalone element
Metadata
Metadata
Assignees
Labels
No labels