Skip to content

2781 Work on ObjectValue - #3033

Merged
ewoutkramer merged 20 commits into
develop-6.0from
2781-work-on-objectvalue
Feb 26, 2025
Merged

2781 Work on ObjectValue#3033
ewoutkramer merged 20 commits into
develop-6.0from
2781-work-on-objectvalue

Conversation

@ewoutkramer

@ewoutkramer ewoutkramer commented Feb 7, 2025

Copy link
Copy Markdown
Member

Fixes #2781.

This PR contains several improvements to how ObjectValue and validation are handled on primitives:

  • ObjectValue now always aligns with the json literals, so the ObjectValue is now string for Instance (not DateTimeOffset), and string for Base64Binary (not byte[]).
  • It has delayed parsing from ObjectValue->Value and delayed serialization from Value->ObjectValue for all types.
  • It unifies the validation of the ObjectValue across all primitives: all operations/properties on primitives that access Value will make sure the data is valid, and throw CodedValidationExceptions otherwise.
  • Because the primitives now handle validation of ObjectValue, the parsers don't have to do it anymore, and they have been simplified to mostly just copy the raw value on the line to the ObjectValue, and let the new Primitive validation handle the rest.

⚠️ Make sure to also review and pull FirelyTeam/fhir-codegen#52

@ewoutkramer
ewoutkramer marked this pull request as ready for review February 19, 2025 17:01
Comment thread src/Hl7.Fhir.Base/ElementModel/PocoElementNode.cs
Comment thread src/Hl7.Fhir.Base/Model/Base64Binary.cs
# Conflicts:
#	src/Hl7.Fhir.Base/CompatibilitySuppressions.xml
…781-work-on-objectvalue

# Conflicts:
#	src/Hl7.Fhir.Base/CompatibilitySuppressions.xml
#	src/Hl7.Fhir.Base/FhirPath/ElementNavFhirExtensions.cs
#	src/Hl7.FhirPath.Tests/Tests/CastTests.cs
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