Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/Microsoft.OpenApi/Reader/ParsingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ private void ValidateRequiredFields(OpenApiDocument doc, string version)
// paths is a required field in OpenAPI 3.0 but optional in 3.1
RootNode.Context.Diagnostic.Errors.Add(new OpenApiError("", $"Paths is a REQUIRED field at {RootNode.Context.GetLocation()}"));
}
else if (version.is3_1() && (doc.Paths == null || !doc.Paths.Any()) && (doc.Webhooks == null || !doc.Webhooks.Any()))
{
RootNode.Context.Diagnostic.Errors.Add(new OpenApiError(
"", $"The document MUST contain either a Paths or Webhooks field at {RootNode.Context.GetLocation()}"));
}
}
}
}
Loading