Skip to content

Commit e09fb38

Browse files
committed
chore: simplifies the filter now that null reference exp are not an issue anymore
1 parent 32a5ec5 commit e09fb38

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Microsoft.OpenApi/Models/OpenApiOperation.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,7 @@ public void SerializeAsV2(IOpenApiWriter writer)
278278
var produces = Responses
279279
.Where(static r => r.Value.Content != null)
280280
.SelectMany(static r => r.Value.Content?.Keys ?? [])
281-
.Concat(
282-
Responses
283-
.Select(static r => r.Value)
284-
.OfType<OpenApiResponseReference>()
285-
.Where(static r => r.Reference is {HostDocument: not null})
286-
.SelectMany(static r => r.Content?.Keys ?? []))
281+
.Where(static m => !string.IsNullOrEmpty(m))
287282
.Distinct(StringComparer.OrdinalIgnoreCase)
288283
.ToArray();
289284

0 commit comments

Comments
 (0)