Skip to content

Commit 364952b

Browse files
darrelmillerbaywet
andauthored
Update src/Microsoft.OpenApi.Readers/V2/OpenApiPathItemDeserializer.cs
Co-authored-by: Vincent Biret <[email protected]>
1 parent ea83688 commit 364952b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/Microsoft.OpenApi.Readers/V2/OpenApiPathItemDeserializer.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,13 @@ private static void LoadPathParameters(OpenApiPathItem pathItem, ParseNode node)
9090
var requestBody = CreateFormBody(node.Context, formParameters);
9191
foreach (var opPair in pathItem.Operations.Where(x => x.Value.RequestBody is null))
9292
{
93-
if (opPair.Value.RequestBody == null)
93+
switch (opPair.Key)
9494
{
95-
switch (opPair.Key)
96-
{
97-
case OperationType.Post:
98-
case OperationType.Put:
99-
case OperationType.Patch:
100-
opPair.Value.RequestBody = requestBody;
101-
break;
102-
}
95+
case OperationType.Post:
96+
case OperationType.Put:
97+
case OperationType.Patch:
98+
opPair.Value.RequestBody = requestBody;
99+
break;
103100
}
104101
}
105102
}

0 commit comments

Comments
 (0)