fix: patch openapi-typescript enum generation to match OpenAPI schema#9037
Merged
lstein merged 4 commits intoinvoke-ai:mainfrom Apr 10, 2026
Merged
fix: patch openapi-typescript enum generation to match OpenAPI schema#9037lstein merged 4 commits intoinvoke-ai:mainfrom
lstein merged 4 commits intoinvoke-ai:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openapi-typescriptcomputes enum types fromconstusage 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 fromBaseModelType)typegen.jsthat patches generated string enum types to match the actual OpenAPI schema definitionsschema.tswhen new model bases or other enum values are addedTest plan
make frontend-typegen— regeneratedschema.tsmatches the manually-edited version (confirms"anima"is preserved)pnpm lint:tscpasses with no errors🤖 Generated with Claude Code