-
Notifications
You must be signed in to change notification settings - Fork 347
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
Allow the model to store invalid data and give detailed exceptions about it #3079
base: develop-6.0
Are you sure you want to change the base?
Conversation
# Conflicts: # src/Hl7.Fhir.Base/Model/Generated/Address.cs # src/Hl7.Fhir.Base/Model/Generated/HumanName.cs # src/Hl7.Fhir.Base/Model/Generated/Ratio.cs
…flow marker is present
… constraint ".Any()" and would fail even when the dictionary was found
The helper properties are exposing the null markers, and won't trigger an exception. Maybe let the getters just use the normal property instead of the backing field, that should solve the problem |
We've hit a subtle snag here, which is characteristic of everything we've with moving over to the POCOs: Since POCO is King, then so is the model, defined by the attributes on the POCOs. However, we don't always stick to it for now - mostly because of the "Since" parameters on the attributes. This means that for SOME versions of FHIR a datatype is different, or an element did not yet exist. We're not using this information at all in the new model validation. We did in the parsers (they are using the right version of the ModelInspector), but our (attribute) validators don't account for it yet. Also, when we return the type of the element in the PocoNode, we return the physical type, which is not always the FHIR type (this is, I think, only relevant for the The good news is: we have the information. Since we're dealing with POCOs and this is encoded on the POCOs. However, we've shied away from using metadata most of the times (although we annotated ModelInspector sometimes I think), and the ValidationContext has no notion of FHIR version yet. So, I have moved #2982 on this sprint, since I think we should do something with the FHIR version while validating the model:
A nice last design discussion! |
Description
Related issues
implements #3056
Codegen PR: FirelyTeam/fhir-codegen#55