-
Notifications
You must be signed in to change notification settings - Fork 344
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
#2910 Make Base implement IScopedNode - phase 1 #2913
base: develop-6.0
Are you sure you want to change the base?
Conversation
…copednode' into spike/make-resource-implement-iscopednode # Conflicts: # src/Hl7.Fhir.Serialization.R4.Tests/RoundtripSignature.cs
…copednode' into spike/make-resource-implement-iscopednode
@@ -15,7 +15,7 @@ namespace Hl7.Fhir.ElementModel | |||
public static class TypedElementExtensions | |||
{ | |||
public static ITypedElement ToTypedElement(this Base @base, string? rootName = null) | |||
=> @base.ToTypedElement(ModelInfo.ModelInspector, rootName); | |||
=> @base.WithScopeInfo(@base.BuildRoot(rootName)); |
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.
Flag for removal after spike.
Serialization is still binary breaking, but not source breaking. It now takes Base instead of Resource |
…igator removed IBaseElementNavigator<T>
src/Hl7.Fhir.Base/Serialization/engine/ElementModelSerializationEngine.cs
Show resolved
Hide resolved
…node # Conflicts: # src/Hl7.Fhir.Base/CompatibilitySuppressions.xml # src/Hl7.Fhir.Base/Model/Base.cs
…copednode' into spike/make-resource-implement-iscopednode
@@ -1,12 +1,334 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids --> | |||
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |||
<Suppression> |
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.
Make sure you add info about the breaking changes to the PR, including alternatives that people can use.
@@ -90,7 +90,7 @@ public static Quantity ParseQuantity(this ITypedElement instance) | |||
|
|||
[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " + | |||
"the near future.")] | |||
public static Quantity ParseQuantityInternal<T>(this IBaseElementNavigator<T> instance) where T : IBaseElementNavigator<T> | |||
public static Quantity ParseQuantityInternal(this ITypedElement instance) |
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.
The introduction of IBaseElementNavigator made it necessary to make these public, I think they can be internal again - in any case the reference to IBaseElementNavigator in the Obsolete should be changed!
// Wellioht is er ook nog iets met de directe properties "Extension.url" en "Element.id" die van een | ||
// system type zijn ipv een FHIR type. | ||
string? ITypedElement.InstanceType => | ||
((IStructureDefinitionSummary) |
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.
We should not need a ModelInspector anymore.
src/Hl7.Fhir.Base/Serialization/engine/ElementModelSerializationEngine.cs
Show resolved
Hide resolved
@@ -73,7 +73,7 @@ public static class SerializationEngineExtensions | |||
/// </summary> | |||
/// <exception cref="InvalidOperationException">Thrown if the underlying engine is a legacy engine</exception> | |||
/// <exception cref="DeserializationFailedException">Thrown if a FHIR error was encountered in the data</exception> | |||
public static Resource? SerializeReaderToXml(this IFhirSerializationEngine engine, XmlReader reader) | |||
public static Base? SerializeReaderToXml(this IFhirSerializationEngine engine, XmlReader reader) |
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.
Ok, so a breaking change, make sure to put it in the PR.
Description
This first step makes POCO's implement ITypedElement. Since we no longer supply an
ITypedElement.Definition
, we had to patch some of the parsers to get all unit-tests back to work. In the end, these changes to the parsers will be reverted, they are just made to be able to continue testing with our extensive set of tests on ITypedElement.Related issues
#2894, #2895
Testing
Tested by making Base.ToTypedElement() point to this implementation. This is temporary.