Skip to content

[3/n] expand cycle detection tests#23

Merged
sunshowers merged 3 commits into
mainfrom
sunshowers/spr/3n-expand-cycle-detection-tests
May 12, 2026
Merged

[3/n] expand cycle detection tests#23
sunshowers merged 3 commits into
mainfrom
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.)

@sunshowers sunshowers merged commit e13832c into main May 12, 2026
8 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/3n-expand-cycle-detection-tests branch May 12, 2026 17:05
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