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

Make IElementSchemaResolver and ElementSchema public #237

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

marcovisserFurore
Copy link
Member

In the Firely Validator we use a CarElementSchemaResolver, which implements IElementSchemaResolver. This was first internal and in this PR this has been made public.

{
// Schemas representing the root of a FHIR datatype cannot meaningfully be used as a GroupValidatable,
// so we'll turn this into a normal IValidatable.
var results = input.Select((i, index) => Validate(i, vc, state.UpdateInstanceLocation(d => d.ToIndex(index))));
var results = input.Select((i, index) => ValidateInternal(i, vc, state.UpdateInstanceLocation(d => d.ToIndex(index))));
Copy link
Member

Choose a reason for hiding this comment

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

Here, and in other places, you are now calling ValidateInternal, while conceptually, you should be calling the normal Validate I think. (this will immediately call ValidateInternal in its turn, so there is no technical difference). Validate() is still the main entrance point, dealing with ValidateInternal should I think only be necessary for derived classes - we should make it protected.

@@ -116,6 +119,7 @@ virtual Firely.Fhir.Validation.Canonical.<Clone>$() -> Firely.Fhir.Validation.Ca
virtual Firely.Fhir.Validation.Canonical.EqualityContract.get -> System.Type!
virtual Firely.Fhir.Validation.Canonical.Equals(Firely.Fhir.Validation.Canonical? other) -> bool
virtual Firely.Fhir.Validation.Canonical.PrintMembers(System.Text.StringBuilder! builder) -> bool
virtual Firely.Fhir.Validation.ElementSchema.ToJson() -> Newtonsoft.Json.Linq.JToken!
Copy link
Member

Choose a reason for hiding this comment

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

This is probably the same issue as Validate. Though to have a ToJsonInternal seems overkill here. So just make this public indeed....

@ewoutkramer ewoutkramer merged commit 1ecb390 into develop Dec 19, 2023
3 checks passed
@ewoutkramer ewoutkramer deleted the feature/IElementSchemaResolver-public branch December 19, 2023 16:58
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.

2 participants