Skip to content

Commit 23fde05

Browse files
Merge pull request #1856 from microsoft/mk/make-update-validation-rule
Remove validation rule to make paths and webhooks optional
2 parents 4e50523 + 1941a57 commit 23fde05

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)