Skip to content

fixed context validation for issue #402 among other examples#510

Merged
andrzejskowronski merged 19 commits intodevelop-sdk6from
feature/402-fix-context-validation
Jul 2, 2025
Merged

fixed context validation for issue #402 among other examples#510
andrzejskowronski merged 19 commits intodevelop-sdk6from
feature/402-fix-context-validation

Conversation

@Kasdejong
Copy link
Copy Markdown
Member

@Kasdejong Kasdejong commented Apr 24, 2025

Description

Fixed contextValidation subtype detection.

Related issues

Closes #402

Testing

Added new test to more meticulously test extension context validation of type "Element"

Also review FirelyTeam/fhir-test-cases#62

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issue #402 by fixing context validation for extensions and refactoring the associated test and validation logic. Key changes include:

  • Updating test cases and schema resolvers in ExtensionContextValidatorTests.cs to cover both boolean and HumanName contexts.
  • Refactoring the context validation logic in ExtensionContextValidator.cs, including a revised implementation of validateElementContext.
  • Removing the legacy MatchesContext method from DefinitionPath.cs as part of the overall refactoring effort.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/Firely.Fhir.Validation.Tests/Impl/ExtensionContextValidatorTests.cs Updated tests and schema resolvers for improved and more precise context validation.
src/Firely.Fhir.Validation/Impl/ExtensionContextValidator.cs Refactored validateElementContext logic with updated regex matching and parameter usage.
src/Firely.Fhir.Validation/Schema/DefinitionPath.cs Removed the outdated MatchesContext method to simplify context matching logic.
Comments suppressed due to low confidence (1)

src/Firely.Fhir.Validation/Impl/ExtensionContextValidator.cs:114

  • [nitpick] Consider renaming the parameter 'instance' to 'node' to clarify that it represents the current node in the context tree.
private static bool validateElementContext(string contextExpression, PocoNode instance)

Kasdejong and others added 4 commits April 29, 2025 12:45
…ix-context-validation

# Conflicts:
#	test/Firely.Fhir.Validation.Compilation.Tests.Shared/ExtensionContextComponentTests.cs
…ix-context-validation

# Conflicts:
#	test/Firely.Fhir.Validation.Compilation.Tests.Shared/FhirTestCases
@ewoutkramer ewoutkramer self-requested a review April 30, 2025 10:37
@Kasdejong Kasdejong requested a review from ewoutkramer May 28, 2025 13:34
…ix-context-validation

# Conflicts:
#	test/Firely.Fhir.Validation.Compilation.Tests.Shared/FhirTestCases
Base automatically changed from feature/upgrade-sdk-to-6.0.0-alpha2 to develop-sdk6 June 18, 2025 15:16
@andrzejskowronski andrzejskowronski merged commit b198342 into develop-sdk6 Jul 2, 2025
2 checks passed
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.

5 participants