googleapis / google-cloud-rust

Google Cloud Platform Rust [Experimental] Client Libraries
Apache License 2.0
264 stars 18 forks source link

fix(generator/rust): handle sneaky field names #229

Closed coryan closed 2 days ago

coryan commented 2 days ago

Specially with OpenAPI specifications the field name may have gone through a snake_case to camelCase translation. In Rust we want to use snake_case for the fields, but that roundtrip is lossy.

I think the bad field name in Rust is undesirable, but it works. The bad name is the serialized JSON does not work at all. This PR fixes that problem.

Part of the work for #226