Skip to content

fix: patch openapi-typescript enum generation to match OpenAPI schema#9037

Merged
lstein merged 4 commits intoinvoke-ai:mainfrom
lstein:fix/anima-typegen
Apr 10, 2026
Merged

fix: patch openapi-typescript enum generation to match OpenAPI schema#9037
lstein merged 4 commits intoinvoke-ai:mainfrom
lstein:fix/anima-typegen

Conversation

@lstein
Copy link
Copy Markdown
Collaborator

@lstein lstein commented Apr 9, 2026

Summary

  • openapi-typescript computes enum types from const usage in discriminated unions rather than from the enum definition itself, which drops values that only appear in some union members (e.g. "anima" was dropped from BaseModelType)
  • Adds a post-processing step to typegen.js that patches generated string enum types to match the actual OpenAPI schema definitions
  • Prevents future manual edits to schema.ts when new model bases or other enum values are added

Test plan

  • Ran make frontend-typegen — regenerated schema.ts matches the manually-edited version (confirms "anima" is preserved)
  • pnpm lint:tsc passes with no errors
  • Verify on CI that the full lint suite passes

🤖 Generated with Claude Code

openapi-typescript computes enum types from `const` usage in
discriminated unions rather than from the enum definition itself,
dropping values that only appear in some union members (e.g. "anima"
from BaseModelType). Add a post-processing step that patches generated
string enum types to match the actual OpenAPI schema definitions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the frontend PRs that change frontend files label Apr 9, 2026
@lstein lstein added the v6.13.x label Apr 9, 2026
@lstein lstein moved this to 6.13.x Theme: MODELS in Invoke - Community Roadmap Apr 9, 2026
Copy link
Copy Markdown
Collaborator

@Pfannkuchensack Pfannkuchensack left a comment

Choose a reason for hiding this comment

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

works great.

@lstein lstein enabled auto-merge (squash) April 10, 2026 01:44
@lstein lstein merged commit a2e4fbb into invoke-ai:main Apr 10, 2026
13 checks passed
@lstein lstein deleted the fix/anima-typegen branch April 10, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend PRs that change frontend files v6.13.x

Projects

Status: 6.13.x Theme: MODELS

Development

Successfully merging this pull request may close these issues.

2 participants