From f20e12bc60a31981a4b59f789bf5583f10ceddc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Tue, 15 Aug 2023 14:19:14 -0400 Subject: [PATCH] Update to fix validations --- .../__snapshots__/index.spec.ts.snap | 2 +- src/generators/csharp/presets/JsonSerializerPreset.ts | 2 +- .../presets/__snapshots__/JsonSerializerPreset.spec.ts.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/csharp-generate-json-serializer/__snapshots__/index.spec.ts.snap b/examples/csharp-generate-json-serializer/__snapshots__/index.spec.ts.snap index 3ae391fac8..ba6cd1f148 100644 --- a/examples/csharp-generate-json-serializer/__snapshots__/index.spec.ts.snap +++ b/examples/csharp-generate-json-serializer/__snapshots__/index.spec.ts.snap @@ -65,7 +65,7 @@ internal class RootConverter : JsonConverter writer.WriteStartObject(); - if(value.Email != null) { + if(value.Email != null) { // write property name and let the serializer serialize the value itself writer.WritePropertyName(\\"email\\"); JsonSerializer.Serialize(writer, value.Email, options); diff --git a/src/generators/csharp/presets/JsonSerializerPreset.ts b/src/generators/csharp/presets/JsonSerializerPreset.ts index 9179fc28e5..82e6252c49 100644 --- a/src/generators/csharp/presets/JsonSerializerPreset.ts +++ b/src/generators/csharp/presets/JsonSerializerPreset.ts @@ -51,7 +51,7 @@ if (${modelInstanceVariable} != null) { } }`; } - serializeProperties += `if(${modelInstanceVariable} != null) { + serializeProperties += `if(${modelInstanceVariable} != null) { // write property name and let the serializer serialize the value itself writer.WritePropertyName("${propertyModel.unconstrainedPropertyName}"); ${renderSerializeProperty(modelInstanceVariable, propertyModel)} diff --git a/test/generators/csharp/presets/__snapshots__/JsonSerializerPreset.spec.ts.snap b/test/generators/csharp/presets/__snapshots__/JsonSerializerPreset.spec.ts.snap index ff361b1bf2..b5f12109a8 100644 --- a/test/generators/csharp/presets/__snapshots__/JsonSerializerPreset.spec.ts.snap +++ b/test/generators/csharp/presets/__snapshots__/JsonSerializerPreset.spec.ts.snap @@ -85,7 +85,7 @@ internal class TestConverter : JsonConverter } if (propertyName == \\"enumProp\\") { - var value = EnumTestExtension.ToEnumTest(JsonSerializer.Deserialize(ref reader, options)); + var value = EnumTestExtensions.ToEnumTest(JsonSerializer.Deserialize(ref reader, options)); instance.EnumProp = value; continue; }