VONK-5300 Accessing the Definition when visiting all descendants of a ITypedElement #2594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add an access to the Definition property when visiting all descendants of a ITypedElement in order to detect element with an invalid definition .
Background for this PR: In Vonk, for the patch operation, we create a PartToElementAdapter (see https://github.com/FirelyTeam/Vonk/blob/0b352a37b8d717b4c590622dc5d89347670e5c54/src/Vonk.Core/ElementModel/FhirPatchedElement.cs#L176) with the field to patch. In case of a non-existing field for the resource type to be patched, when getting the definition of the element, we get an exception. So, as part of the prevalidation for the patch operation, we would like to check that both the value but also the definition of all the PartToElementAdapter are valid.
see PR fixing the issue locally in VONK: https://github.com/FirelyTeam/Vonk/pull/1300
Related issues
VONK-5300
Testing
Tested using Firely Server. See https://github.com/FirelyTeam/Vonk/pull/1300
FirelyTeam Checklist