File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/Microsoft.OpenApi/Reader Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -271,10 +271,10 @@ 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 ) )
274+ if ( ( version . is2_0 ( ) || version . is3_0 ( ) ) && ( doc . Paths == null ) && RootNode is not null )
275275 {
276276 // paths is a required field in OpenAPI 2.0 and 3.0 but optional in 3.1
277- RootNode ? . Context . Diagnostic . Errors . Add ( new OpenApiError ( "" , $ "Paths is a REQUIRED field at { RootNode . Context . GetLocation ( ) } ") ) ;
277+ RootNode . Context . Diagnostic . Errors . Add ( new OpenApiError ( "" , $ "Paths is a REQUIRED field at { RootNode . Context . GetLocation ( ) } ") ) ;
278278 }
279279 }
280280 }
You can’t perform that action at this time.
0 commit comments