Repository navigation
Ignore meta.profile entries without a string value - #711
Closed
claude[bot] wants to merge 1 commit into
Closed
claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
ResourceSchema.GetMetaProfileSchemas cast every meta.profile value to string, so an entry without a value (valid when it carries an extension) threw ArgumentNullException, and a non-string value threw InvalidCastException. Only entries with a string value name a profile. Fixes #710 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rh3MA8tHrtq2e4fERVBj9i
Member
|
Duplicate of #712 712 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested via Slack thread
Description
Before: Validating a resource whose
meta.profileentry has no string value threw instead of returning an outcome. An entry without a value (valid FHIR when it carries an extension, e.g."_profile": [{"extension": [{"url": ".../data-absent-reason", "valueCode": "unknown"}]}]) threwArgumentNullExceptionin every deserialization mode, and a non-string value kept by a lenient parse ("profile": [5]) threwInvalidCastException.After: Such entries are skipped when collecting the meta profiles, so they no longer throw at this point and the remaining entries are still used.
ResourceSchema.GetMetaProfileSchemasnow only turnsmeta.profileentries with a string value into canonicals.How:
new Canonical((string)pn.GetValue()!)becamepn.GetValue()filtered withOfType<string>()before creating theCanonical. An entry without a value names no profile to validate against; reporting an invalid value remains the job of the element's own validators.Note: a non-string value like
"profile": [5]still throws later, inCanonicalValidator(wrong-typed-value problem #559/#561). That is not covered here.Related issues
Fixes #710
Testing
Added to
ResourceSchemaTests: a value-less_profileentry (Strict, Recoverable and SyntaxOnly) is ignored while a valid entry is kept, aResourceSchemavalidation of a resource with a value-less entry returns an outcome without throwing, and a non-string value (5) is ignored byGetMetaProfileSchemas. All five new cases fail without the fix; the fullFirely.Fhir.Validation.Testsproject passes (338 tests, net10.0).Generated by Claude Code