We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I use tag on a (flatten) enum, and add a field with the same name, on a struct serde will output a json with a duplicated field.
// struct #[derive(Debug, Serialize, Deserialize)] pub struct CreateEvent { #[serde(rename = "type")] ty: EventTypeDiscriminants, from: NaiveDateTime, to: NaiveDateTime, #[serde(flatten)] data: CreateEventType, } // CreateEventType #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "type", content = "data")] pub enum CreateEventType { #[serde(rename = "field")] Field, #[serde(rename = "class")] Class(CreateClass), }
output
{ "type": "class", "from": "1970-01-01T00:00:00", "to": "1970-01-01T00:00:00", "type": "class", "data": { "teacher_id": "usr_b7a7zAh6XlTeN4azMcCFL" } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I use tag on a (flatten) enum, and add a field with the same name, on a struct serde will output a json with a duplicated field.
output
The text was updated successfully, but these errors were encountered: