Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate indexing while validating non-recurring elements #369

Open
Kasdejong opened this issue Sep 26, 2024 · 0 comments
Open

Investigate indexing while validating non-recurring elements #369

Kasdejong opened this issue Sep 26, 2024 · 0 comments

Comments

@Kasdejong
Copy link
Contributor

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.

  1. 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.
  2. We add indices to the instance path, even when an element is not recurring. This does not make sense to me.
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant