Skip to content

Commit 12f6499

Browse files
Copilotbaywet
andcommitted
refactor: make V2 LoadExtension consistent with other versions
Moved the return statement for JsonNodeExtension outside the catch block to match the pattern used in V3, V31, and V32 deserializers. Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
1 parent 50b44aa commit 12f6499

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Microsoft.OpenApi/Reader/V2/OpenApiV2Deserializer.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,10 @@ private static IOpenApiExtension LoadExtension(string name, ParseNode node)
8787
{
8888
ex.Pointer = node.Context.GetLocation();
8989
node.Context.Diagnostic.Errors.Add(new(ex));
90-
return new JsonNodeExtension(node.CreateAny());
9190
}
9291
}
93-
else
94-
{
95-
return new JsonNodeExtension(node.CreateAny());
96-
}
92+
93+
return new JsonNodeExtension(node.CreateAny());
9794
}
9895

9996
private static string? LoadString(ParseNode node)

0 commit comments

Comments
 (0)