Skip to content

Conversation

daxpedda
Copy link
Collaborator

@daxpedda daxpedda commented May 15, 2025

Adds serde::De/Serialize support.

I've got the idea from serde-rs/serde#1900. The idea is to basically emit the whole item in the attribute macro again, let serde_derive do its thing and then remove it with another attribute macro that just voids the duplicate item again.

Resolves #100.

@daxpedda daxpedda force-pushed the serde branch 4 times, most recently from 1f5b0cc to c7b81d2 Compare May 16, 2025 07:55
- Instead, if the crate feature is not enabled, we say that in the error message instead.
- Implement `Serialize` skeleton.
- Hook up `serde` in the CI.
- Handle `#[serde(...)]` attributes without `De/Serialize`.
- Add tests for all these new errors.
- Add test to check for `#[derive(De/Serialize)`]` support without `#[derive_where(De/Serialize)]`.
@daxpedda
Copy link
Collaborator Author

The implementation is done, barring any bugs that still come up during testing.
I'm gonna add a complete test suite later today.

@daxpedda daxpedda marked this pull request as ready for review May 16, 2025 16:12
@daxpedda daxpedda requested a review from ModProg May 16, 2025 16:12
@daxpedda
Copy link
Collaborator Author

This is good to go!

@daxpedda daxpedda merged commit 9fe2802 into ModProg:main May 17, 2025
98 checks passed
@fjarri
Copy link

fjarri commented Jun 1, 2025

This is great! Could you make a release with this change?

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.

derive_where for serde
3 participants