Skip to content

fix unwrap panic with internally tagged enums#1020

Merged
ahl merged 1 commit into
mainfrom
issue-1019
Jun 13, 2026
Merged

fix unwrap panic with internally tagged enums#1020
ahl merged 1 commit into
mainfrom
issue-1019

Conversation

@ahl

@ahl ahl commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

The problem occurs when an internally tagged enum derives its name from the title of the schema. In that situation, if a variant contains a property that is itself a type that requires a name (e.g. a struct), we fail to pass down a name that can be used and fail on the None. Instead, we need to pass down the name we'll eventually choose for the generated enum so that subtypes can derive a name from that root.

Closes #1019

The problem occurs when an internally tagged enum derives its name from
the title of the schema. In that situation, if a variant contains a
property that is itself a type that requires a name (e.g. a struct), we
fail to pass down a name that can be used and fail on the None. Instead,
we need to pass down the name we'll eventually choose for the generated
enum so that subtypes can derive a name from that root.
@ahl ahl merged commit d9a8910 into main Jun 13, 2026
4 checks passed
@ahl ahl deleted the issue-1019 branch June 13, 2026 04:32
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.

Issue: panic (Option::unwrap on None) — oneOf variants sharing a const-discriminator property

1 participant