From 3deda5a7e62447d9ff3790647b3df936084a2d8b Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Tue, 30 Jul 2024 10:35:50 +0200 Subject: [PATCH] Added back constructor --- src/Hl7.Fhir.Base/Serialization/FhirJsonConverter.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Hl7.Fhir.Base/Serialization/FhirJsonConverter.cs b/src/Hl7.Fhir.Base/Serialization/FhirJsonConverter.cs index 7cdf4057ad..0562001381 100644 --- a/src/Hl7.Fhir.Base/Serialization/FhirJsonConverter.cs +++ b/src/Hl7.Fhir.Base/Serialization/FhirJsonConverter.cs @@ -80,7 +80,6 @@ internal void SetMode(DeserializerModes mode) public class FhirJsonConverter : JsonConverter where F : Base { - // internal for testing purposes private readonly PocoSerializationEngine _engine; private FhirJsonConverter(IFhirSerializationEngine engine) @@ -100,6 +99,12 @@ public FhirJsonConverter( // nothing } + [Obsolete("Using this directly is not recommended. Instead, try creating a converter using the .ForFhir static method of the JsonSerializerOptions class")] + public FhirJsonConverter( + Assembly assembly, FhirJsonPocoSerializerSettings? serializerSettings = null, FhirJsonPocoDeserializerSettings? deserializerSettings = null, + Predicate? ignoreFilter = null) : + this(FhirSerializationEngineFactory.Custom(ModelInspector.ForAssembly(assembly), ignoreFilter ?? (_ => false), deserializerSettings, serializerSettings)){} + /// /// Constructs a that (de)serializes FHIR json for the /// POCOs in a given assembly.