Skip to content

feat: hoist definitions of JSON Schemas returned by cast resolvers - #50

Merged
schmurfy merged 2 commits into
schmurfy:masterfrom
birotaio:feature/hoist_resolver_definitions
Oct 6, 2026
Merged

schmurfy merged 2 commits into
schmurfy:masterfrom
birotaio:feature/hoist_resolver_definitions

Conversation

@zoov-xavier

Copy link
Copy Markdown
Contributor

A cast resolver (chipi:"as:...") may return a standalone JSON Schema declaring its own definitions / $defs and referencing them locally (#/definitions/x). Once embedded in the OpenAPI document those refs resolve against the document root and are broken.

chipi now moves these definitions to components/schemas as custom_<castName>.<name> and rewrites the local refs, including refs between definitions. The resolver schema is copied first, so a resolver returning a shared schema is left untouched and every generation hoists again.

Note: TestSchema "should use oneof as refs for enums and cast fields with as:" already fails on master, unrelated to this change.

🤖 Generated with Claude Code

zoov-xavier and others added 2 commits September 28, 2026 08:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schmurfy
schmurfy merged commit 59b306a into schmurfy:master Oct 6, 2026
1 of 3 checks passed
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.

2 participants