Serde currently has a useful rename_all attribute for renaming all structure fields automatically when a non-snake case naming convention is used for serialization/deserialization.
This could be useful for cases like the ConnectionCredentials structure (not the best example because of all the ID parts) or various property dicts from the BlueZ API (see here).
Not renaming the fields automatically is obviously a good idea since e.g. PolicyKit APIs use the snake-case naming convention for properties.
I'll be happy to provide a PR if this is acceptable.
In GitLab by @turbocooler on Jan 17, 2023, 16:39
Serde currently has a useful
rename_all
attribute for renaming all structure fields automatically when a non-snake case naming convention is used for serialization/deserialization.This could be useful for cases like the
ConnectionCredentials
structure (not the best example because of all theID
parts) or various property dicts from the BlueZ API (see here).Not renaming the fields automatically is obviously a good idea since e.g. PolicyKit APIs use the snake-case naming convention for properties.
I'll be happy to provide a PR if this is acceptable.