From 464658623352c9cd7f12703e7d1eaf39bee73fa6 Mon Sep 17 00:00:00 2001 From: v-haiboz Date: Thu, 8 Jul 2021 13:56:13 +0800 Subject: [PATCH] BUG 454655:[REST]Miss value in docs. --- .../RestOperationTransformer.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs b/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs index d55f43d..94d5ab8 100644 --- a/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs +++ b/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs @@ -1369,7 +1369,21 @@ private static void ResolveObject(string key, JObject nodeObject, DefinitionObje { definitionObject.IsRequired = true; } - var requiredProperties = nodeObjectDict.GetArrayFromMetaData("required"); + var requiredProperties = nodeObjectDict.GetArrayFromMetaData("required"); + + if (requiredFields != null) + { + if (requiredProperties == null) + { + requiredProperties = requiredFields; + } + else + { + var requiredPropertiesList = requiredProperties.ToList(); + requiredPropertiesList.AddRange(requiredFields.ToList()); + requiredProperties = requiredPropertiesList.ToArray(); + } + } definitionObject.DiscriminatorKey = nodeObjectDict.GetValueFromMetaData("discriminator"); definitionObject.DiscriminatorValue = nodeObjectDict.GetValueFromMetaData("x-ms-discriminator-value");