Skip to content

Properly merge discriminator when combining schema's using allOf#1738

Closed
alexbakker wants to merge 1 commit into
oapi-codegen:mainfrom
alexbakker:fix-discriminator-allof
Closed

Properly merge discriminator when combining schema's using allOf#1738
alexbakker wants to merge 1 commit into
oapi-codegen:mainfrom
alexbakker:fix-discriminator-allof

Conversation

@alexbakker

Copy link
Copy Markdown

Previously, when combining two schema's using allOf, the discriminator would not carry over to the resulting merged schema.

@alexbakker alexbakker requested a review from a team as a code owner August 25, 2024 09:42
Previously, when combining two schema's using allOf, the discriminator
would not carry over to the resulting merged schema.
@alexbakker alexbakker force-pushed the fix-discriminator-allof branch from a2a29c9 to 8507cc4 Compare August 26, 2024 16:09
@alexbakker

Copy link
Copy Markdown
Author

@jamietanna What's the status here?

@mromaszewicz

Copy link
Copy Markdown
Member

Thank you for submitting this PR, @alexbakker — but we need to close it because the same fix (propagating the discriminator field when merging allOf schemas) landed via #667 (commit 05503ded, merged March 2026). pkg/codegen/merge_schemas.go:388-397 now propagates s1.Discriminator or s2.Discriminator to result.Discriminator in allOf context, with test coverage in merge_schemas_test.go.

Thanks for the contribution.

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