Hi,
I have a json which contains multiple fields which have different fields which are named such that they get converted to the same struct fields.
Here's a minimal example to show this behavior:
{
"type": "record",
"name": "my_name",
"fields": [
{"name": "field_name", "type": "int"},
{"name": "fieldName", "type": "string"}
]
}
This gets converted to
#[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)]
pub struct MyName {
#[serde(rename = "fieldName")]
pub field_name: String,
#[serde(rename = "fieldName")]
pub field_name: String,
}
When the order of the fields is inverted, the result is identical, but without the serde-renames and the type of both fields becomes i32.
It would be nice if there was an option in override_field to change the name as well to resolve this issue.