File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/Microsoft.OpenApi.Readers Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -248,14 +248,14 @@ public void PopLoop(string loopid)
248
248
249
249
private void ValidateRequiredFields ( OpenApiDocument doc , string version )
250
250
{
251
- if ( ( version == "2.0" || version . StartsWith ( "3.0" ) ) && ( doc . Paths == null || doc . Paths . Any ( ) ) )
251
+ if ( ( version == "2.0" || version . StartsWith ( "3.0" ) ) && ( doc . Paths == null || ! doc . Paths . Any ( ) ) )
252
252
{
253
253
// paths is a required field in OpenAPI 3.0 but optional in 3.1
254
254
RootNode . Context . Diagnostic . Errors . Add ( new OpenApiError ( "" , $ "Paths is a REQUIRED field at { RootNode . Context . GetLocation ( ) } ") ) ;
255
255
}
256
256
else if ( version . StartsWith ( "3.1" ) )
257
257
{
258
- if ( ( doc . Paths == null || doc . Paths . Count == 0 ) && ( doc . Webhooks == null || doc . Webhooks . Any ( ) ) )
258
+ if ( ( doc . Paths == null || ! doc . Paths . Any ( ) ) && ( doc . Webhooks == null || ! doc . Webhooks . Any ( ) ) )
259
259
{
260
260
RootNode . Context . Diagnostic . Errors . Add ( new OpenApiError (
261
261
"" , $ "The document MUST contain either a Paths or Webhooks field at { RootNode . Context . GetLocation ( ) } ") ) ;
You can’t perform that action at this time.
0 commit comments