Skip to content
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

RUST-1699: Add serde_with 3.x integration #422

Merged
merged 16 commits into from
Jul 27, 2023
Merged

Conversation

drshika
Copy link
Contributor

@drshika drshika commented Jul 19, 2023

Added serde_with 3.x support. Docs

@drshika drshika requested a review from abr-egn July 19, 2023 19:23
@drshika drshika marked this pull request as draft July 19, 2023 19:34
Cargo.toml Outdated
@@ -65,13 +65,13 @@ lazy_static = "1.4.0"
uuid-0_8 = { package = "uuid", version = "0.8.1", features = ["serde", "v4"], optional = true }
uuid = { version = "1.1.2", features = ["serde", "v4"] }
serde_bytes = "0.11.5"
serde_with = { version = "1", optional = true }
serde_with1 = { package = "serde_with", version = "1.3.1", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to keep the existing one without renaming it so that existing users turning on the serde_with feature will continue to get the same version.

@drshika drshika requested a review from abr-egn July 20, 2023 19:47
README.md Outdated Show resolved Hide resolved
src/uuid/mod.rs Outdated
@@ -509,6 +509,30 @@ macro_rules! trait_impls {
uuid.serialize(serializer)
}
}

#[cfg(all($feat, feature = "serde_with3"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this (and below) need to be feature = "serde_with-3" to match Cargo.toml.

Cargo.toml Outdated Show resolved Hide resolved
@drshika drshika requested a review from abr-egn July 21, 2023 15:19
README.md Outdated
@@ -50,8 +50,8 @@ Note that if you are using `bson` through the `mongodb` crate, you do not need t
| `chrono-0_4` | Enable support for v0.4 of the [`chrono`](https://docs.rs/chrono/0.4) crate in the public API. | n/a | no |
| `uuid-0_8` | Enable support for v0.8 of the [`uuid`](https://docs.rs/uuid/0.8) crate in the public API. | n/a | no |
| `uuid-1` | Enable support for v1.x of the [`uuid`](https://docs.rs/uuid/1.0) crate in the public API. | n/a | no |
| `serde_with` | Enable [`serde_with`](https://docs.rs/serde_with/latest) integrations for `bson::DateTime` and `bson::Uuid` | serde_with | no |

| `serde_with` | Enable [`serde_with`](https://docs.rs/serde_with/latest) 1.x integrations for `bson::DateTime` and `bson::Uuid`.| serde_with | no |
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm doing a terrible job reviewing for which I apologize! Reading this made me go look and there are also implementations for crate::DateTime which will need serde_with_3 versions as well.

@drshika drshika requested a review from abr-egn July 21, 2023 16:29
Copy link
Contributor

@abr-egn abr-egn left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@isabelatkinson isabelatkinson left a comment

Choose a reason for hiding this comment

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

just a few suggestions! we also have documentation sections about serde_with for DateTime and Uuid. I think we should update the references to serde_with to be serde_with-3 instead to encourage users to be on the latest version. Something like:

The serde_with-3 feature (or serde_with feature for version 1.x) can be enabled...

Cargo.toml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/uuid/mod.rs Show resolved Hide resolved
drshika and others added 4 commits July 25, 2023 14:06
Co-authored-by: Isabel Atkinson <[email protected]>
Co-authored-by: Isabel Atkinson <[email protected]>
Co-authored-by: Isabel Atkinson <[email protected]>
:
@drshika drshika marked this pull request as ready for review July 27, 2023 16:47
@drshika drshika merged commit 09a8cbb into main Jul 27, 2023
@drshika drshika deleted the RUST-1669/Add-Serde-3.x branch July 27, 2023 16:47
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.

3 participants