Skip to content

[3/n] expand cycle detection tests#23

Open
sunshowers wants to merge 3 commits intomainfrom
sunshowers/spr/3n-expand-cycle-detection-tests
Open

[3/n] expand cycle detection tests#23
sunshowers wants to merge 3 commits intomainfrom
sunshowers/spr/3n-expand-cycle-detection-tests

Conversation

@sunshowers
Copy link
Copy Markdown
Contributor

@sunshowers sunshowers commented May 8, 2026

Rename tests/cases/cycle-shared-prefix to tests/cases/cycle-detection to reflect the broader scope, and extend the fixture with a few different kinds of cycles:

  • mutual recursion through $ref
  • three-way cycle
  • mutual recursion through allOf wrappers
  • asymmetric tests where the old and new schemas have different shapes

Also add tests to verify the outputs. (We're going to rework cycle detection a bit in #15 and want to ensure that PR doesn't introduce any behavior changes.)

sunshowers added 2 commits May 8, 2026 15:04
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
sunshowers added a commit that referenced this pull request May 8, 2026
Created using spr 1.3.6-beta.1
Comment on lines +4 to +11
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/AltX"
+ "$ref": "#/components/schemas/AltY"
}
}
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test covers the A->B->A to B->A->B cycle issue, which it turns out we already handled. (Again, wanted to ensure that #15 didn't regress this.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant