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

Passing "bytes" type with json api #118

Closed
x2bool opened this issue Mar 3, 2018 · 6 comments
Closed

Passing "bytes" type with json api #118

x2bool opened this issue Mar 3, 2018 · 6 comments

Comments

@x2bool
Copy link

x2bool commented Mar 3, 2018

bool object fields are stored as Booleans in JSON. int32, int53 and double fields are stored as Numbers. int64 and string fields are stored as Strings. vectors are stored as Arrays.

bytes type is not documented. Is it possible to pass bytes with JSON API?

@isopen
Copy link
Contributor

isopen commented Mar 3, 2018

I think it's worth a try.

@x2bool
Copy link
Author

x2bool commented Mar 3, 2018

I mean what JSON type should I use to serialize/deserialize bytes?

@isopen
Copy link
Contributor

isopen commented Mar 3, 2018

String. But let's wait for the answer of more qualified specialists.

@arseny30
Copy link
Contributor

arseny30 commented Mar 3, 2018

Yes it is possible, bytes will be automatically encoded and decoded with base64url and sent as a string.

@x2bool
Copy link
Author

x2bool commented Mar 3, 2018

Great! Thanks!

@x2bool x2bool closed this as completed Mar 3, 2018
@levlam
Copy link
Contributor

levlam commented Mar 3, 2018

Bytes should be encoded/decoded with plain base64, not with base64url, but they are definitely supported and will be mentioned in the documentation.

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

4 participants