Skip to content

Conversation

@ttnTrifork
Copy link
Contributor

This fixes #7338

  • ValidatorWrapper now adheres to its property 'errorForUnknownProfiles' when validating a resource with an unknown profile

  • Updated BaseHapiFhirResourceDao.validate to ensure $validate returns an error severity issue if target profile is unknown, regardless of the value of the ValidatorWrapper errorForUnknownProfiles property.

…ownProfiles' when validating a resource with an unknown profile. Updated BaseHapiFhirResourceDao.validate to ensure $validate returns an error severity issue if target profile is unknown, regardless of the value of the ValidatorWrapper 'errorForUnknownProfiles' property.

This fixes hapifhir#7338
@robogary
Copy link
Contributor

Formatting check succeeded!

@tadgh
Copy link
Collaborator

tadgh commented Oct 29, 2025

Heya, I appreciate the PR! I do have some concerns about it though. This specifically will change existing behaviour of the system in a non-backwards-compatible way. My understanding is that this PR makes $validate ignore the validator setting. I understand that this is what the spec says, but we prefer not to break existing behaviour unless absolutely necessary.

Is there a reason that you cannot just set this setting to true, and have the behaviour you intend?

Forgive me if I'm missing some nuance, validation is not my area of specialization.

@tadgh
Copy link
Collaborator

tadgh commented Oct 29, 2025

Heya, I appreciate the PR! I do have some concerns about it though. This specifically will change existing behaviour of the system in a non-backwards-compatible way. My understanding is that this PR makes $validate ignore the validator setting. I understand that this is what the spec says, but we prefer not to break existing behaviour unless absolutely necessary.

Is there a reason that you cannot just set this setting to true, and have the behaviour you intend?

Forgive me if I'm missing some nuance, validation is not my area of specialization.

Having now read the original issue (sorry I missed it originally), I see the reasoning much more clearly now. Approved pending the addition of a changelog in 8_8_0 changelogs folder.

Copy link
Collaborator

@tadgh tadgh left a comment

Choose a reason for hiding this comment

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

Approved pending a changelog

@ttnTrifork
Copy link
Contributor Author

Thanks! I updated #7338 a bit so its easier to read

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.

Bug: Validation with unknown profile cause error even when setting FhirInstanceValidator.setErrorForUnknownProfiles(false)

3 participants