Add support for "overflow" to POCOs #2851
Labels
breaking change
This issue/commit causes a breaking change, and requires a major version upgrade
enhancement
idea
Something to think about
needs research
SDK-6
Issues related to the development of firely-net-sdk v6
At this moment, POCOs only have properties for the elements defined in the FHIR specification. In many POCO serialization/deserialization frameworks, there is support for overflow, where "unknown" data can still be retained while parsing, and thus be processed and serialized later on. Also, metadata can be modified to supply type information for such unknown properties. Implemented at its fullest we could:
Base
?). If we don't have type information for that property, we would represent the contents of the json as a Dictionary.Going even further we could try to support not only unknown, but incorrect data too:
This would greatly enhance our capabilities to deal with newer data by older clients, or start working with newer (unpublished) versions of FHIR, without having to work with prereleases or multiple versions of the SDK. Or even fully custom resources.
There are numerous ways to achieve this, and also a number of issues that may arise, and I will just start off a list below:
IReadOnlyDictionary
directly by POCO's confuses libraries and tools and we would like to undo that design. This means that, if we chose to implementIDictionary
, we should also not directly do this on the public interface of a resource. The projected C# 13 extension interfaces and adapters would have been a great help here, if they'd ever see the light.The text was updated successfully, but these errors were encountered: