SwaggerAssertions icon indicating copy to clipboard operation
SwaggerAssertions copied to clipboard

Possible issue in resolving recursive references

Open azambon opened this issue 3 years ago • 0 comments

I think I found an issue with the way references are resolved by the SchemaManager::fromUri() method. If I use a call to SchemaManager::fromUri() to initialize the SchemaManager and then use that manager to validate a response whose schema involves recursive references, the validation goes off into an infinite loop. However, if I use the SchemaStorage to import the json schema first (thereby pre-resolving all references) and then create the SchemaManager manually from the resolved schema, everything works fine.

Attached is a test case that I built starting from the example reported by @MaikWagner in #53 . Depending on which way the SchemaManager is instanciated (the test includes both ways, one comment and the other not), the test either is green or goes into an infinite loop.

test.zip

azambon avatar Jun 13 '22 10:06 azambon