Skip to content

fix: resolve nested remote schema references - #160

Merged
Himenon merged 2 commits into
mainfrom
codex/issue-90-remote-reference
Sep 7, 2026
Merged

fix: resolve nested remote schema references#160
Himenon merged 2 commits into
mainfrom
codex/issue-90-remote-reference

Conversation

@Himenon

@Himenon Himenon commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

This pull request fixes Issue #90, where a schema referenced from a remote document could contain another local reference and cause a stack overflow during code generation.

Reference resolution now uses the document containing each reference as the base point, and traverses nested local and remote references across multiple documents. The regression scenario covers the following chain:

v1 → v0#/components/schemas/Book → v0#/components/schemas/BookIDAlias → v2#/components/schemas/BookID

The implementation also detects circular schema references and includes Japanese comments explaining the reference-resolution flow.

Test Plan

The change follows a two-commit TDD sequence:

  1. 94cd890 adds only the Issue Bug: complex remote reference is broken #90 reproduction fixtures. CI failed as expected with RangeError: Maximum call stack size exceeded in findSchemaByPathArray.
  2. 6989bd0 adds the implementation, regression tests, complex chained-reference fixtures, and updated snapshots.

Verification:

  • pnpm test passes: 43 unit tests and 55 snapshot tests.
  • Type checking and Biome checks pass.
  • GitHub Actions Build passes on Ubuntu and Windows.

Closes #90

@Himenon
Himenon force-pushed the codex/issue-90-remote-reference branch 4 times, most recently from bb773a3 to 80202dd Compare September 7, 2026 13:16
@Himenon
Himenon force-pushed the codex/issue-90-remote-reference branch from 80202dd to 6989bd0 Compare September 7, 2026 13:20
@Himenon
Himenon merged commit 8474ab0 into main Sep 7, 2026
2 checks passed
@Himenon
Himenon deleted the codex/issue-90-remote-reference branch September 7, 2026 14:06
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.

Bug: complex remote reference is broken

1 participant