@@ -57,18 +57,21 @@ public void RemoveAnyOfAndOneOfFromSchema()
5757            var  walker  =  new  OpenApiWalker ( powerShellFormatter ) ; 
5858            walker . Walk ( openApiDocument ) ; 
5959
60-             var  testSchema  =  openApiDocument . Components . Schemas [ "TestSchema" ] ; 
61-             var  averageAudioDegradationProperty  =  testSchema . Properties [ "averageAudioDegradation" ] ; 
62-             var  defaultPriceProperty  =  testSchema . Properties [ "defaultPrice" ] ; 
60+             var  testSchema  =  openApiDocument . Components ? . Schemas ? [ "TestSchema" ] ; 
61+             var  averageAudioDegradationProperty  =  testSchema ? . Properties [ "averageAudioDegradation" ] ; 
62+             var  defaultPriceProperty  =  testSchema ? . Properties [ "defaultPrice" ] ; 
6363
6464            // Assert 
65-             Assert . Null ( averageAudioDegradationProperty . AnyOf ) ; 
66-             Assert . Equal ( "number" ,  averageAudioDegradationProperty . Type ) ; 
67-             Assert . Equal ( "float" ,  averageAudioDegradationProperty . Format ) ; 
68-             Assert . True ( averageAudioDegradationProperty . Nullable ) ; 
69-             Assert . Null ( defaultPriceProperty . OneOf ) ; 
70-             Assert . Equal ( "number" ,  defaultPriceProperty . Type ) ; 
71-             Assert . Equal ( "double" ,  defaultPriceProperty . Format ) ; 
65+             Assert . NotNull ( openApiDocument . Components ) ; 
66+             Assert . NotNull ( openApiDocument . Components . Schemas ) ; 
67+             Assert . NotNull ( testSchema ) ; 
68+             Assert . Null ( averageAudioDegradationProperty ? . AnyOf ) ; 
69+             Assert . Equal ( "number" ,  averageAudioDegradationProperty ? . Type ) ; 
70+             Assert . Equal ( "float" ,  averageAudioDegradationProperty ? . Format ) ; 
71+             Assert . True ( averageAudioDegradationProperty ? . Nullable ) ; 
72+             Assert . Null ( defaultPriceProperty ? . OneOf ) ; 
73+             Assert . Equal ( "number" ,  defaultPriceProperty ? . Type ) ; 
74+             Assert . Equal ( "double" ,  defaultPriceProperty ? . Format ) ; 
7275            Assert . NotNull ( testSchema . AdditionalProperties ) ; 
7376        } 
7477
@@ -83,12 +86,12 @@ public void ResolveFunctionParameters()
8386            var  walker  =  new  OpenApiWalker ( powerShellFormatter ) ; 
8487            walker . Walk ( openApiDocument ) ; 
8588
86-             var  idsParameter  =  openApiDocument . Paths [ "/foo" ] . Operations [ OperationType . Get ] . Parameters . Where ( static  p =>  p . Name  ==  "ids" ) . FirstOrDefault ( ) ; 
89+             var  idsParameter  =  openApiDocument . Paths ? [ "/foo" ] . Operations [ OperationType . Get ] . Parameters ? . Where ( static  p =>  p . Name  ==  "ids" ) . FirstOrDefault ( ) ; 
8790
8891            // Assert 
8992            Assert . Null ( idsParameter ? . Content ) ; 
9093            Assert . NotNull ( idsParameter ? . Schema ) ; 
91-             Assert . Equal ( "array" ,  idsParameter ? . Schema . Type ) ; 
94+             Assert . Equal ( "array" ,  idsParameter . Schema . Type ) ; 
9295        } 
9396
9497        private  static OpenApiDocument  GetSampleOpenApiDocument ( ) 
0 commit comments