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

Deserialize bytes (i.e. Vec<U8>) from a json array of integer #121

Open
lpzantony opened this issue Feb 22, 2024 · 0 comments
Open

Deserialize bytes (i.e. Vec<U8>) from a json array of integer #121

lpzantony opened this issue Feb 22, 2024 · 0 comments

Comments

@lpzantony
Copy link

Hello,

First of, thank you for your work on pbjson. It saves a lot of handcrafted serde fine tuning. Especially the fact that pbjson can deserialize enums either from their value or from their name, super handy.

One last thing I wonder about pbjson: it seems that the only way to deserialize a Protobuf bytes (i.e. a Vec<u8>) is to have it expressed as a base64 string, like "data": "AAAH4AEM",. If I do submit the following "data": "[ 0, 0, 7, 224, 1, 12 ]",, it returns an error because it expects a base64 string.

I know the official Protobuf's recommendation for JSON mapping does recommend using base64 strings for bytes. I just wonder if it would be possible to also support deserialization of bytes from a JSON int array? Similarly to what is recommended for repeated.

Regards

AL

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

No branches or pull requests

1 participant