You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$ref changes are dropped when a document has any circular reference #662
If a document contains any circular reference, CheckSchemaProxyForCircularRefs returns true for every schema proxy, including ones that are not part of the loop. CompareSchemas then returns nil in its $ref branches, so changes to those schemas are not reported at all.
openapi-changes report old.yaml new.yaml reports no changes. Remove A and B from both files and it reports the $ref change.
The cause is that the journey check (source) keeps one dup map across all circular references and returns true on any repeated entry, without comparing it to s. A journey always repeats its loop point (B -> A -> B), so the first circular reference makes the function return true.
A fix needs care. The dup check is currently also what stops QuickHash from recursing through cross-file cycles. A relative $ref such as b.yaml#/B doesn't match the journey's Definition or FullDefinition, so a narrower check that compares s.GetReference() hangs on those documents. A journey also includes the path leading into the loop, not just the loop itself. So the check probably needs to compare the proxy's resolved full definition against Journey[LoopIndex:]. Does that direction make sense to you? Happy to work on a PR once we agree on the approach.
@daveshanley I worked out a node-based loop-tail check that handles cross-file cycles cleanly and keeps inline schemas out of the circular set under UseSchemaQuickHash. Opened in #667 whenever you have a moment to review.
Activity
josephaxisa commentedon Oct 22, 2026
@daveshanley I worked out a node-based loop-tail check that handles cross-file cycles cleanly and keeps inline schemas out of the circular set under UseSchemaQuickHash. Opened in #667 whenever you have a moment to review.