Skip to content

Conversation

@leovalais
Copy link

closes #865

Hi and thanks for utoipa!

Adds an enum-level attribute to generate the title of its variants. By default it is the concatenation of the enum's and the variant's name. If the enum has an explicit title set, it is used as prefix instead. All variant titles can be overridden using the field-level title attribute.

Like the issue author I've encountered some issues with code generators on rich enums. I tried to keep the new feature as simple as possible but let me know if there's missing functionality.

I'm also not sure how (or even if) it should relate to serde attributes.

Adds an enum-level attribute to generate the `title` of its variants. By
default it is the concatenation of the enum's and the variant's name. If
the enum has an explicit `title` set, it is used as prefix instead. All
variant titles can be overridden using the field-level `title`
attribute.
@leovalais leovalais marked this pull request as ready for review January 8, 2026 17:30
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.

[Feature Request] Automatically derive "title" for Enum Variants

1 participant