swagger-parser
swagger-parser copied to clipboard
Unnecessary logging of "avoiding infinite loop" in ResolverFully
This is a very minor issue but I think the debug logging in ResolverFully.resolveSchemaProperty may be incorrect. It currently logs (at debug level) "avoiding infinite loop" if it doesn't find an existing entry for a property in the map of already resolved properties. Seems like it should log that message if it does find an entry. At the moment, in our project, we're seeing this message for every single property (and we never hit the "else" path of the if, which I think you'd hit if there was genuinely chance of a loop).
There is a similar log statement earlier in the file - in the resolveSchema method - and it follows the pattern I'd expect: it logs if there is an existing entry (as might happen if following a loop) but doesn't log if there is no entry and it needs to process the schema.