Skip to content

Conversation

@HugoHSun
Copy link
Contributor

Summary

Fixes #407

The onCircular callback was only invoked for the first detection of each unique circular reference target, not for every occurrence. This was an unintended side effect of the caching optimizations in #380 and #381.

Changes

  • Added foundCircularReference(path, $refs, options) calls before returning cached circular results in lib/dereference.ts
  • Updated circular-extensive tests to verify correct callback counts (118 paths with circular: true, 173 with circular: 'ignore')
  • Added new circular-multi-occurrence test specifically targeting the multiple occurrence scenario

Notes

@coveralls
Copy link

coveralls commented Jan 24, 2026

Pull Request Test Coverage Report for Build 21308961385

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 86.441%

Totals Coverage Status
Change from base Build 21308896778: 0.02%
Covered Lines: 955
Relevant Lines: 1070

💛 - Coveralls

@jonluca jonluca enabled auto-merge (squash) January 24, 2026 04:10
@jonluca jonluca merged commit 78b3323 into APIDevTools:main Jan 24, 2026
13 checks passed
@github-actions
Copy link

🎉 This PR is included in version 15.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onCircular callback not called for all occurrences of circular $refs (only fires on first detection)

3 participants