Skip to content

Conversation

@Sufflope
Copy link

@Sufflope Sufflope commented Oct 9, 2025

Fixes #247

Copy link
Contributor

@Kriskras99 Kriskras99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good option for implementing support for #[serde(flatten)].
The one thing I don't like, is that we store the the flatten boolean in the custom attributes of RecordSchema. However, the only alternative I see, is adding another field to that struct which would be a breaking change.

@martin-g what do you think?

@Sufflope Sufflope force-pushed the 247_support_serde_flatten_in_derive branch from 319bf1d to 8ceeae9 Compare October 10, 2025 14:12
@martin-g
Copy link
Member

@martin-g what do you think?

Honestly, I don't want to maintain anything Serde related :-|
Every time I tried to dive deep into Serde related code I see hacks and functionalities contradicting with each other.
I am not smart enough to understand why the serde crate is so popular...

@Kriskras99
Copy link
Contributor

Serde is popular because it's really easy to use as a user. The complicated parts are hidden in serde itself and any crate implementing formats.

@Sufflope in the async work I'm also trying to make the serde part easier to maintain, I'll get back to this PR after the async work.

@Kriskras99
Copy link
Contributor

Kriskras99 commented Nov 25, 2025

I think this is the wrong approach. I think the flattened fields should be included in the derived schema directly, so that the writer doesn't need to add special support for this.

Also, correct me if I'm wrong, but this PR only works for people using Writer::append_ser not those using to_value?

@Kriskras99
Copy link
Contributor

Kriskras99 commented Dec 9, 2025

@Sufflope thank you for your PR (and your temporary serdavro crate)!. We have a more maintainable and complete implementation in #359, so I'll close this PR in favour of that one.
Other improvements to the Serde/Avro integration are tracked in #361, if you run into more problems with Serde/Avro integration please let us know!

@Kriskras99 Kriskras99 closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing support for #[serde(flatten)] for derive AvroSchema

3 participants