Skip to content

fix(codegen): prevent discriminator variant merging with original model - #144

Merged
kudlatyamroth merged 1 commit into
feature/dockerfile-with-batteriesfrom
bugfix/merge-similar-and-swagger-discriminator
Aug 27, 2026
Merged

kudlatyamroth merged 1 commit into
feature/dockerfile-with-batteriesfrom
bugfix/merge-similar-and-swagger-discriminator

Conversation

@kudlatyamroth

Copy link
Copy Markdown
Collaborator

When --merge-similar-models is enabled, the modified oneOf variant (with the discriminator field removed) was merged back into the original referenced model because both shared the same schema_hash. Clear the schema_hash after mutating the variant so it is treated as a distinct model and the generated internally tagged enum no longer requires the discriminator field on each variant.

When --merge-similar-models is enabled, the modified oneOf variant
(with the discriminator field removed) was merged back into the
original referenced model because both shared the same schema_hash.
Clear the schema_hash after mutating the variant so it is treated as
a distinct model and the generated internally tagged enum no longer
requires the discriminator field on each variant.
@kudlatyamroth
kudlatyamroth merged commit c934aca into master Aug 27, 2026
12 checks passed
@kudlatyamroth
kudlatyamroth deleted the bugfix/merge-similar-and-swagger-discriminator branch August 27, 2026 14:50
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