diff --git a/src/Microsoft.OpenApi/Models/OpenApiMediaType.cs b/src/Microsoft.OpenApi/Models/OpenApiMediaType.cs index 609ea5ccd..553e87d09 100644 --- a/src/Microsoft.OpenApi/Models/OpenApiMediaType.cs +++ b/src/Microsoft.OpenApi/Models/OpenApiMediaType.cs @@ -109,15 +109,12 @@ private void SerializeExamples(IOpenApiWriter writer, IDictionary kvp.Value.Value is OpenApiArray arr && arr.Count == 0)) { - if (kvp.Value.Value is OpenApiArray arr && arr.Count == 0) - { - writer.WritePropertyName(kvp.Key); - writer.WriteStartObject(); - writer.WriteRequiredObject(OpenApiConstants.Value, kvp.Value.Value, (w, v) => w.WriteAny(v)); - writer.WriteEndObject(); - } + writer.WritePropertyName(kvp.Key); + writer.WriteStartObject(); + writer.WriteRequiredObject(OpenApiConstants.Value, kvp.Value.Value, (w, v) => w.WriteAny(v)); + writer.WriteEndObject(); } writer.WriteEndObject(); }