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

Binary (0x05) data type for BSON to JSON conversion #1668

Closed
frankipl opened this issue Jul 12, 2019 · 9 comments
Closed

Binary (0x05) data type for BSON to JSON conversion #1668

frankipl opened this issue Jul 12, 2019 · 9 comments
Assignees
Labels
aspect: binary formats BSON, CBOR, MessagePack, UBJSON kind: enhancement/improvement solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@frankipl
Copy link

  • Describe the feature in as much detail as possible.

Here is list of supported data types for conversion from BSON to JSON
data types
Would it be possible to add (0x05) binary data type to covert to JSON as Base64 encoded string ?

Best Regards
Marek

@nlohmann
Copy link
Owner

There is currently a PR #1662 working on binary data types in JSON. It's not using Base64 strings, but vector of bytes. It should also fit BSON. What do you think?

@nlohmann nlohmann added the aspect: binary formats BSON, CBOR, MessagePack, UBJSON label Jul 13, 2019
@OmnipotentEntity
Copy link
Contributor

To add, the pull request only supports serialization to the 0x00 binary subtype; however, serialization from any binary subtype ought to be supported. Though this requires testing, and the PR is still in development.

While this does mean that the library isn't transparent under encoding and decoding, this was selected to simplify the implementation and kick the can down the road a bit.

@nlohmann
Copy link
Owner

The PR is the first step to actually support binary types for CBOR, MessagePack, UBJSON, and BSON. Full support of all BSON subtypes would be the next step, I'm afraid.

@frankipl
Copy link
Author

HI
I understand. Thanks for looking into it.
Best,
Marek

@stale
Copy link

stale bot commented Aug 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Aug 15, 2019
@stale stale bot closed this as completed Aug 22, 2019
@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated labels Apr 16, 2020
@nlohmann nlohmann self-assigned this Apr 16, 2020
@nlohmann nlohmann added this to the Release 3.8.0 milestone Apr 16, 2020
@nlohmann
Copy link
Owner

Binary types were added with #1662.

@themightyoarfish
Copy link

If this is now supported, is the documentation outdated? In the doxygen for 3.9 it still says "still unsupported" for binary.

@nlohmann
Copy link
Owner

nlohmann commented Aug 5, 2020

Good point - I shall have a look.

nlohmann added a commit that referenced this issue Aug 10, 2020
@nlohmann
Copy link
Owner

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aspect: binary formats BSON, CBOR, MessagePack, UBJSON kind: enhancement/improvement solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

4 participants