Skip to content

Commit 8bc957d

Browse files
Merge pull request #1090 from microsoft/mk/fix-null-style-parameter-issue
Fix Reader always sets OpenApiParameter.Style
2 parents 429d7c5 + d4b6c00 commit 8bc957d

11 files changed

+601
-29
lines changed

src/Microsoft.OpenApi/Models/OpenApiParameter.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,12 @@ public void SerializeAsV3WithoutReference(IOpenApiWriter writer)
239239

240240
// allowEmptyValue
241241
writer.WriteProperty(OpenApiConstants.AllowEmptyValue, AllowEmptyValue, false);
242-
242+
243243
// style
244-
writer.WriteProperty(OpenApiConstants.Style, Style?.GetDisplayName());
244+
if (_style.HasValue)
245+
{
246+
writer.WriteProperty(OpenApiConstants.Style, Style.Value.GetDisplayName());
247+
}
245248

246249
// explode
247250
writer.WriteProperty(OpenApiConstants.Explode, Explode, Style.HasValue && Style.Value == ParameterStyle.Form);

0 commit comments

Comments
 (0)