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)
248248
249249 private void ValidateRequiredFields ( OpenApiDocument doc , string version )
250250 {
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 ( ) ) )
252252 {
253253 // paths is a required field in OpenAPI 3.0 but optional in 3.1
254254 RootNode . Context . Diagnostic . Errors . Add ( new OpenApiError ( "" , $ "Paths is a REQUIRED field at { RootNode . Context . GetLocation ( ) } ") ) ;
255255 }
256256 else if ( version . StartsWith ( "3.1" ) )
257257 {
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 ( ) ) )
259259 {
260260 RootNode . Context . Diagnostic . Errors . Add ( new OpenApiError (
261261 "" , $ "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