Skip to content

Commit 1941a57

Browse files
committed
Remove validation rule to make paths and webhooks optional
1 parent 7261ad9 commit 1941a57

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/Microsoft.OpenApi/Reader/ParsingContext.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,6 @@ private void ValidateRequiredFields(OpenApiDocument doc, string version)
276276
// paths is a required field in OpenAPI 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
}
279-
else if (version.is3_1() && (doc.Paths == null || !doc.Paths.Any()) && (doc.Webhooks == null || !doc.Webhooks.Any()))
280-
{
281-
RootNode.Context.Diagnostic.Errors.Add(new OpenApiError(
282-
"", $"The document MUST contain either a Paths or Webhooks field at {RootNode.Context.GetLocation()}"));
283-
}
284279
}
285280
}
286281
}

0 commit comments

Comments
 (0)