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

[Validator] Also validate the instance type when the definition has children #2236

Conversation

mmsmits
Copy link
Member

@mmsmits mmsmits commented Sep 13, 2022

fixes: #2183

}
}
else
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block should move to line 41 (so just under var instanceType = ModelIInfo.FhirTypeNameToFhirType(..) : it's applicable to both choice and non-choice elements.

{
// Only one type present in list of typerefs, all of the typerefs are candidates
outcome.Include(validator.ValidateTypeReferences(typeRefs, instance, state));
validator.Trace(outcome, "ElementDefinition is a choice or contains a polymorphic type constraint, but the instance does not indicate its actual type",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a reachable code path when choices.Count() = 1.

@ewoutkramer ewoutkramer merged commit 7e7a32c into develop-stu3 Sep 14, 2022
@ewoutkramer ewoutkramer deleted the bugfix/2183-also-validate-parent-type-when-validating-children branch September 14, 2022 13:04
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

Successfully merging this pull request may close these issues.

Validator ignores valueString for value type sliced to be Quantity
2 participants