Skip to content

Conversation

erunion
Copy link
Member

@erunion erunion commented Apr 14, 2025

🧰 Changes

We uncovered a problem with the dereferencing functionality within our OpenAPI parser on schemas with an extensive amount of circular references where under these circumstances it could take upwards to an hour to dereference a schema. I was able to trace it down to being a problem within @apidevtools/json-schema-ref-parser where because it was not always using its internal cache it would get into situations where, when parsing a circular reference, it would often attempt to re-parse that same reference multiple times.

I submitted a fix for this over in APIDevTools/json-schema-ref-parser#380, and this pulls that in along with builds a unit test around one of these problematic schemas.

@erunion erunion added the bug Something isn't working label Apr 14, 2025
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the cache improvements I did in @apidevtools/json-schema-ref-parser we are now calling onCircular less times in our parser because we are no longer processing schemas that have already been processed.

@erunion erunion requested review from a team, ashacs, t-tullis and trishaprile and removed request for a team April 14, 2025 16:40
Copy link
Contributor

@llimllib llimllib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this rules

@erunion erunion merged commit efd7aaf into main Apr 14, 2025
8 checks passed
@erunion erunion deleted the fix/validation-slowdowns branch April 14, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants