-
Notifications
You must be signed in to change notification settings - Fork 47
Support serde flatten annotation for schema derivation and de/serialization #311
New issue
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
Conversation
6e65f7f to
319bf1d
Compare
Kriskras99
left a comment
There was a problem hiding this 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?
319bf1d to
8ceeae9
Compare
Honestly, I don't want to maintain anything Serde related :-| |
|
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. |
|
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 |
|
@Sufflope thank you for your PR (and your temporary |
Fixes #247