Skip to content

Commit 03edbc9

Browse files
committed
Allow empty paths object as valid
1 parent 1338905 commit 03edbc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.OpenApi/Reader/ParsingContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ public void PopLoop(string loopid)
271271

272272
private void ValidateRequiredFields(OpenApiDocument doc, string version)
273273
{
274-
if ((version.is2_0() || version.is3_0()) && (doc.Paths == null || !doc.Paths.Any()))
274+
if ((version.is2_0() || version.is3_0()) && (doc.Paths == null))
275275
{
276-
// paths is a required field in OpenAPI 3.0 but optional in 3.1
276+
// paths is a required field in OpenAPI 2.0 and 3.0 but optional in 3.1
277277
RootNode.Context.Diagnostic.Errors.Add(new OpenApiError("", $"Paths is a REQUIRED field at {RootNode.Context.GetLocation()}"));
278278
}
279279
}

0 commit comments

Comments
 (0)