-
Notifications
You must be signed in to change notification settings - Fork 6
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
Handle irregular camelCase to snake_case conversion #2
Comments
Is there an upstream issue for this? Had a bit of a look, and nothing matching AFAIKT. But I did see people saying they could inject serde annotations to certain types in the config with https://docs.rs/prost-build/0.9.0/prost_build/struct.Config.html#method.type_attribute : let mut config = prost_build::Config::new();
config.type_attribute(".", "#[derive(Serialize)]");
config.type_attribute(".", "#[serde(rename_all = \"camelCase\")]"); also there are people looping* over the output to do stuff (here just a rename) we could in the worst-case to a search and replace on the file :| Anyway, if there is no upstream issue for this we should raise one if needed. |
I don't think so. tokio-rs/prost#207 is kind of similar (preserving the original name can be done by passing an identity function). |
Looking at this again. We can indeed mass replace known broken names at the end. I did this for the type names in #49 for alignment with type names in k8s-openapi, so i think it makes more sense now. |
Some irregular camel case to snake case conversions are failing (e.g.,
clusterIPs
becomescluster_i_ps
). Butprost_build
doesn't provide a way to fix this at the moment.The text was updated successfully, but these errors were encountered: