-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Experimental support for binary type and CBOR (de)serialization #862
Experimental support for binary type and CBOR (de)serialization #862
Conversation
I'm not sure about the rest of this, but Much better would be |
I shall have a look at this after the 3.0.0 release next week. |
@gregmarr: you're absolutely right. The point was to show how binary type can be added, so, if this idea gets approved, I can spend more time polishing the change. Thanks! |
I removed my naive implementation in order to focus mostly on API side of the change. |
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. |
I think we should not extend the JSON value with a binary type, but we may think about a SAX or StAX like parsing Interface that has a callback for binary types. |
Related: #971 |
This issue will be addressed with #971 with a callback for binary types. The JSON value itself will not be changed for this. Thank you for the initial PR. |
First of all huge thanks for creating this library.
I saw a few issues #757, #601 and #483 where people discuss if this library can support
CBOR
's binary data type. Motivation for this pull request is to discuss how easy it would be to add support for such data type.Binary data type is not natural for
JSON
, but many people have to deal with it, especially, when converting fromCBOR
toJSON
.In
C++
, though, we can represent contiguous binary arrays usingstd::string
,std::vector<uint8_t>
,std::list<uint8_t>
,char*
and whatnot. It could be up to the user how to represent and convert this type intoJSON
.Right now the change is mostly about the API aspect (e.g. adding binary type), without actual implementation.
Comments are very welcome! Thanks!