Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing the name of the generated WIT type #2613

Open
jvff opened this issue Oct 13, 2024 · 0 comments
Open

Allow customizing the name of the generated WIT type #2613

jvff opened this issue Oct 13, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@jvff
Copy link
Contributor

jvff commented Oct 13, 2024

Motivation

Currently Witty generates types with names that are kebab-case conversions of the Rust names. It would be useful to allow overriding this behavior when desired, similarly to what serde provides when renaming fields.

Proposal

Update the WitType, WitLoad and WitStore derive macros to obtain the WIT name by trying to read it from a name attribute, and falling back to generating the kebab-case name of the Rust type name if the attribute isn't found.

@jvff jvff added the enhancement New feature or request label Oct 13, 2024
@jvff jvff added this to the Testnet #2 milestone Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant