You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Schemars for schema generation in our project and it has been great!
I have a particular struct that is used to both deserialize from PascalCase XML and serialize to snake_case JSON. When creating a schema, the PascalCase is always used. Am I doing something wrong?
Example:
#[derive(JsonSchema,Serialize,Deserialize)]#[serde(rename_all(deserialize = "PascalCase"))]// for XML input#[serde(rename_all(serialize = "snake_case"))]// JSON outputpubstructMyStruct{pub foo Foo;// schema ends up with "Foo"}
Edit: I also tried "overriding" Serde with a schemars declaration:
#[schemars(rename_all = "snake_case")]
But no luck
The text was updated successfully, but these errors were encountered:
We are using Schemars for schema generation in our project and it has been great!
I have a particular struct that is used to both deserialize from PascalCase XML and serialize to snake_case JSON. When creating a schema, the PascalCase is always used. Am I doing something wrong?
Example:
Edit: I also tried "overriding" Serde with a schemars declaration:
#[schemars(rename_all = "snake_case")]
But no luck
The text was updated successfully, but these errors were encountered: