Skip to content

Commit bbb6ae0

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

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
@@ -69,16 +69,13 @@ private static void LoadPathParameters(OpenApiPathItem pathItem, ParseNode node)
6969
var requestBody = CreateRequestBody(node.Context, bodyParameter);
7070
foreach(var opPair in pathItem.Operations)
7171
{
72-
if (opPair.Value.RequestBody == null)
72+
switch (opPair.Key)
7373
{
74-
switch (opPair.Key)
75-
{
76-
case OperationType.Post:
77-
case OperationType.Put:
78-
case OperationType.Patch:
79-
opPair.Value.RequestBody = requestBody;
80-
break;
81-
}
74+
case OperationType.Post:
75+
case OperationType.Put:
76+
case OperationType.Patch:
77+
opPair.Value.RequestBody = requestBody;
78+
break;
8279
}
8380
}
8481
}

0 commit comments

Comments
 (0)