From 4462a2610d3e408ac52980367d31faae8003bd7e Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Thu, 4 Feb 2021 18:45:32 -0800 Subject: [PATCH] selection marks allows null (#18452) --- .../Models/KeyValueElement.Serialization.cs | 4 ++-- .../Generated/Models/ReadResult.Serialization.cs | 2 +- .../Azure.AI.FormRecognizer/src/autorest.md | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/KeyValueElement.Serialization.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/KeyValueElement.Serialization.cs index c45b0443706e0..b12c7b5aec857 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/KeyValueElement.Serialization.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/KeyValueElement.Serialization.cs @@ -15,7 +15,7 @@ internal partial class KeyValueElement { internal static KeyValueElement DeserializeKeyValueElement(JsonElement element) { - Optional type = default; + Optional type = default; string text = default; Optional> boundingBox = default; Optional> elements = default; @@ -25,7 +25,7 @@ internal static KeyValueElement DeserializeKeyValueElement(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); + type = null; continue; } type = new KeyValueType(property.Value.GetString()); diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/ReadResult.Serialization.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/ReadResult.Serialization.cs index 954952640630f..1a8d2e6d525f2 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/ReadResult.Serialization.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/ReadResult.Serialization.cs @@ -80,7 +80,7 @@ internal static ReadResult DeserializeReadResult(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); + selectionMarks = null; continue; } List array = new List(); diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md index c0c7d8b31541c..8433f7710bc89 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md @@ -32,6 +32,22 @@ directive: $.properties.documentResults["x-nullable"] = true; ``` +``` yaml +directive: + from: swagger-document + where: $.definitions.ReadResult + transform: > + $.properties.selectionMarks["x-nullable"] = true; +``` + +``` yaml +directive: + from: swagger-document + where: $.definitions.KeyValueType + transform: > + $["x-nullable"] = true; +``` + ``` yaml directive: from: swagger-document