Skip to content

Conversation

@richarddd
Copy link

Many projects have moved to indexmap2 causing serde_with to pull in duplicate deps

@richarddd richarddd requested a review from a team as a code owner December 15, 2025 09:57
@richarddd richarddd requested a review from abr-egn December 15, 2025 09:57
@abr-egn
Copy link
Contributor

abr-egn commented Dec 15, 2025

The typical approach for this sort of situation is for crates that use mongodb and serde_with to include their own [dependencies] entry for serde_with including that feature, and the dependency resolution feature unification will propagate it. Does that not work in this case?

@richarddd
Copy link
Author

The typical approach for this sort of situation is for crates that use mongodb and serde_with to include their own [dependencies] entry for serde_with including that feature, and the dependency resolution feature unification will propagate it. Does that not work in this case?

Thats a valid workaround, but shouldn't the the default behavior be what benefits most users? I.E use indexmap2 so explicit feature flags per transitive dependency can be avoided for most cases?

@abr-egn
Copy link
Contributor

abr-egn commented Dec 16, 2025

I.E use indexmap2 so explicit feature flags per transitive dependency can be avoided for most cases?

That leaves anyone who happens not to be using indexmap2 with unused/duplicate dependencies that can't easily be worked around short of forking the driver, though.

@richarddd
Copy link
Author

I.E use indexmap2 so explicit feature flags per transitive dependency can be avoided for most cases?

That leaves anyone who happens not to be using indexmap2 with unused/duplicate dependencies that can't easily be worked around short of forking the driver, though.

That's correct, or it should be forwarded so we can choose on mongodb which indexmap we want. I actually think that specifying my own serde_with dep in this case is simpler so will close this PR. However, from ergonomic perspective it a bit strange to have unused deps in Cargo.toml for the sake of explicitly selecting features on transitive deps.

@richarddd richarddd closed this Dec 16, 2025
@univerz
Copy link

univerz commented Dec 16, 2025

I think the correct solution is to make a PR to serde_with to remove indexmap_1 from default features. The PR adding indexmap_2 is >2 years old, as is the last indexmap 1st version.

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