Skip to content

Commit

Permalink
chore: simplifies the filter now that null reference exp are not an i…
Browse files Browse the repository at this point in the history
…ssue anymore
  • Loading branch information
baywet committed Feb 3, 2025
1 parent 3468b5a commit b363f11
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Microsoft.OpenApi/Models/OpenApiOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,7 @@ public void SerializeAsV2(IOpenApiWriter writer)
var produces = Responses
.Where(static r => r.Value.Content != null)
.SelectMany(static r => r.Value.Content?.Keys ?? [])
.Concat(
Responses
.Select(static r => r.Value)
.OfType<OpenApiResponseReference>()
.Where(static r => r.Reference is {HostDocument: not null})
.SelectMany(static r => r.Content?.Keys ?? []))
.Where(static m => !string.IsNullOrEmpty(m))
.Distinct(StringComparer.OrdinalIgnoreCase)
.ToArray();

Expand Down

0 comments on commit b363f11

Please sign in to comment.