Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Biret <vibiret@microsoft.com>
  • Loading branch information
millicentachieng and baywet authored Oct 6, 2022
1 parent e5ed1a6 commit bd577c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Microsoft.OpenApi/Models/OpenApiOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ public void SerializeAsV2(IOpenApiWriter writer)
if (Responses != null)
{
var produces = Responses
.Where(r => r.Value.Content != null)
.SelectMany(r => r.Value.Content?.Keys)
.Where(static r => r.Value.Content != null)
.SelectMany(static r => r.Value.Content?.Keys)
.Concat(
Responses
.Where(static r => r.Value.Reference != null && r.Value.Reference.HostDocument != null)
.SelectMany(r => r.Value.GetEffective(r.Value.Reference.HostDocument)?.Content?.Keys))
.SelectMany(static r => r.Value.GetEffective(r.Value.Reference.HostDocument)?.Content?.Keys))
.Distinct()
.ToList();

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Models/OpenApiRequestBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ internal OpenApiBodyParameter ConvertToBodyParameter()
Name = "body",
Schema = Content.Values.FirstOrDefault()?.Schema ?? new OpenApiSchema(),
Required = Required,
Extensions = Extensions.ToDictionary(k => k.Key, v => v.Value) // Clone extensions so we can remove the x-bodyName extensions from the output V2 model.
Extensions = Extensions.ToDictionary(static k => k.Key, static v => v.Value) // Clone extensions so we can remove the x-bodyName extensions from the output V2 model.
};
if (bodyParameter.Extensions.ContainsKey(OpenApiConstants.BodyName))
{
Expand Down

0 comments on commit bd577c6

Please sign in to comment.