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

feat: add bson ObjectId impl #340

Merged
merged 7 commits into from
Jul 24, 2024

Conversation

ShaunSHamilton
Copy link
Contributor

Goal

The docs suggest the bson-uuid-impl feature flag implements types from bson. However, this is misleading, because it just implements TS for bson::Uuid.

On top of this, the library suggests there is a bson feature flag. However, enabling this does nothing. So, this pr adds an impl for bson::oid::ObjectId which is a particularly common type.

This PR does not expect to implement every exported type from bson. Hopefully, this will be done in future releases of ts-rs.

Related to #186

Changes

  • Added bson::oid::ObjectId impl under bson feature config.
  • Changed lib docs about bson feature flag

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

Notes

The docs suggest running cargo +nightly fmt. However, after running this, unrelated files were changed. So, those have not been pushed.

bson serializes ObjectId into { "$oid": <string> }. However, this is likely not what users want in their types.

README.md Outdated Show resolved Hide resolved
@gustavo-shigueo gustavo-shigueo merged commit e268437 into Aleph-Alpha:main Jul 24, 2024
8 checks passed
@ShaunSHamilton ShaunSHamilton deleted the feat_bson-objectid branch July 24, 2024 19:51
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.

2 participants