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

Rust generator may need to override JSON name #97

Open
coryan opened this issue Nov 5, 2024 · 0 comments
Open

Rust generator may need to override JSON name #97

coryan opened this issue Nov 5, 2024 · 0 comments
Labels
generator Issues related to the code generator priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@coryan
Copy link
Contributor

coryan commented Nov 5, 2024

Rarely, protos have annotations to override the JSON encoding:

https://github.com/googleapis/googleapis/blob/bb6b53e326ce2db403d18be7158c265e07948920/grafeas/v1/sbom.proto#L57

Sometimes, the mapping from OpenAPI -> snake_case -> camelCase may produce undesirable results (think networkIP -> network_i_p, yuck, and network_ip -> networkIp sigh). We may want to override the serde field rename in a handful of cases.

We should try to keep the generated code readable, and avoid decorating each filed with a #[serde(...)] attribute.

@coryan coryan added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. generator Issues related to the code generator labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Issues related to the code generator priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant