Skip to content

Name oneOf variants after the value that selects them - #396

Open
tillrohrmann wants to merge 1 commit into
config-reference-tocfrom
config-oneof-variant-labels
Open

Name oneOf variants after the value that selects them#396
tillrohrmann wants to merge 1 commit into
config-reference-tocfrom
config-oneof-variant-labels

Conversation

@tillrohrmann

@tillrohrmann tillrohrmann commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Variants were labelled "Option 1: None", "Option 2: Fixed delay", and the type field inside each one rendered completely blank. Nothing on the page said that picking one means writing type = "exponential".

Variants are now named after exactly that line, taken from the discriminator the schema already carries as "type": {"const": "exponential"}.

Scalar variants had the same problem for the same reason — the Rust title was preferred over the const — so log-format now offers "pretty" rather than "Option 1: Pretty", and max-attempts offers "unlimited" or integer.


Stack created with GitHub Stacks CLIGive Feedback 💬

@tillrohrmann
tillrohrmann force-pushed the config-oneof-variant-labels branch from f541d0d to 0953574 Compare September 1, 2026 11:10
@tillrohrmann
tillrohrmann force-pushed the config-oneof-variant-labels branch 2 times, most recently from 36363de to d6ca090 Compare September 1, 2026 21:02
Variants were labelled "Option 1: None", "Option 2: Fixed delay", and the
`type` field inside each one rendered completely blank. Nothing on the page
said that picking one means writing `type = "exponential"`.

Variants are now named after that line, taken from the discriminator the
schema already carries as `"type": {"const": "exponential"}`. Scalar variants
had the same problem: log-format now offers `"pretty"` rather than
"Option 1: Pretty", because the const is preferred over the Rust title.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tillrohrmann
tillrohrmann force-pushed the config-oneof-variant-labels branch from d6ca090 to af9e0f4 Compare September 1, 2026 21:08
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