@@ -280,7 +280,7 @@ public void ResolveSubSchema_ShouldRecurseIntoAllOfComposition()
280280 Assert . Equal ( JsonSchemaType . Integer , result ! . Type ) ;
281281 }
282282 [ Fact ]
283- public async Task SHouldResolveRelativeSubReference ( )
283+ public async Task ShouldResolveRelativeSubReference ( )
284284 {
285285 // Arrange
286286 var filePath = Path . Combine ( SampleFolderPath , "relativeSubschemaReference.json" ) ;
@@ -296,5 +296,27 @@ public async Task SHouldResolveRelativeSubReference()
296296 Assert . Equal ( JsonSchemaType . Array , seq2Property . Items . Type ) ;
297297 Assert . Equal ( JsonSchemaType . String , seq2Property . Items . Items . Type ) ;
298298 }
299+ [ Fact ]
300+ public async Task ShouldResolveRecursiveRelativeSubReference ( )
301+ {
302+ // Arrange
303+ var filePath = Path . Combine ( SampleFolderPath , "recursiveRelativeSubschemaReference.json" ) ;
304+
305+ // Act
306+ var ( actual , _) = await OpenApiDocument . LoadAsync ( filePath , SettingsFixture . ReaderSettings ) ;
307+
308+ var fooComponentSchema = actual . Components . Schemas [ "Foo" ] ;
309+ var fooSchemaParentProperty = fooComponentSchema . Properties [ "parent" ] ;
310+ Assert . NotNull ( fooSchemaParentProperty ) ;
311+ var fooSchemaParentPropertyTagsProperty = fooSchemaParentProperty . Properties [ "tags" ] ;
312+ Assert . NotNull ( fooSchemaParentPropertyTagsProperty ) ;
313+ Assert . Equal ( JsonSchemaType . Array | JsonSchemaType . Null , fooSchemaParentPropertyTagsProperty . Type ) ;
314+ Assert . Equal ( JsonSchemaType . Object , fooSchemaParentPropertyTagsProperty . Items . Type ) ;
315+
316+ var fooSchemaTagsProperty = fooComponentSchema . Properties [ "tags" ] ;
317+ Assert . NotNull ( fooSchemaTagsProperty ) ;
318+ Assert . Equal ( JsonSchemaType . Array | JsonSchemaType . Null , fooSchemaTagsProperty . Type ) ;
319+ Assert . Equal ( JsonSchemaType . Object , fooSchemaTagsProperty . Items . Type ) ;
320+ }
299321 }
300322}
0 commit comments