Nexmo / oas_parser

An open source Open API Spec 3 Definition Parser
MIT License
51 stars 16 forks source link

added cache on resolving refs and fixed #24 #25

Closed MarioRuiz closed 4 years ago

MarioRuiz commented 5 years ago

apart of a solution for #24 , adds also a cache for returning the already resolved refs instead of resolving again.

mheap commented 5 years ago

Hey @MarioRuiz, sorry that this has taken so long to review. I finally got chance to sit down and test it out. The code works great for things that reference themselves (with the exception that an array becomes [{}] rather than []) but fails for circular dependencies that aren't self-referential.

I've checked how tools such as Redoc work and they don't handle recursion at all. Given the complexity this adds I think we should either make it handle all recursive cases and raise an exception, or not merge this change