-
Notifications
You must be signed in to change notification settings - Fork 345
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
Replace PocoBuilder to support overflow #2953
base: develop-6.0
Are you sure you want to change the base?
Replace PocoBuilder to support overflow #2953
Conversation
using ET = Hl7.Fhir.ElementModel.Types; | ||
using ElementMappingInfo = (Hl7.Fhir.Introspection.ClassMapping Class, Hl7.Fhir.Introspection.PropertyMapping? Property); | ||
|
||
namespace Hl7.Fhir.Serialization; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly better suited for Elementmodel namespace
// otherwise it's a DynamicDataType. | ||
// Design question: there might be a "strict" option, where we will not create Dynamic types | ||
// for unknown types, but throw an error instead. | ||
if(node.Value is not null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if instancetype starts with a lowercase letter, since even a primitive could have only extensions
src/Hl7.Fhir.Base/Model/Base.cs
Outdated
[Serializable] | ||
[DataContract] | ||
[FhirType("DynamicDataType","http://fire.ly/fhir/StructureDefinition/DynamicDataType")] | ||
public class DynamicDataType : DataType, IDynamicType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's consider making another part of base, and keeping the Base.cs file as close to the core model as possible
|
||
var poco = toPoco(subject); | ||
|
||
poco.Active.Should().Be(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe try this with IsExactlyEqualTo?
…e-overflow' into 6.0/2947-adapt-pocobuilder-to-use-overflow
Wrote a replacement for PocoBuilder (for now, called PocoBuilderNew, they are internal classes anyway) that implements the new overflow and uses the Dynamic datatype classes for unknown types.
ToPoco()
extension methods to use the new builderFixes #2947 .
Breaking changes
DefaultModelFactory
has been removed. It had not been in use for years, except by our own tests. With the cleanup of the PocoBuilder (ITypedElement->POCO) infrastructure, we decided to remove this class.