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

flatc converts a protobuf 'bytes' field to 'string' in fbs schema file #4099

Closed
cdkamat opened this issue Dec 1, 2016 · 3 comments
Closed

Comments

@cdkamat
Copy link

cdkamat commented Dec 1, 2016

I have a protobuf schema with

optional bytes fingerprint = 1;

I am using flatc --proto to convert it to a fbs schema.

The schema generated has

fingerprint:string;

I was expecting a

fingerprint: [byte];

In the parser code, I see that the mapping is

 { "bytes", BASE_TYPE_STRING },

https://github.com/google/flatbuffers/blob/master/src/idl_parser.cpp#L1729

Is the conversion to string intentional? If the bytes in proto were used to store binary data, will they be compatible with the generated fbs ?

@ghost
Copy link

ghost commented Dec 1, 2016

I agree, [byte] would be better. Under C++, string is about the same, but in other languages it isn't. A PR to fix this would be welcome.

@ghost
Copy link

ghost commented Aug 14, 2017

Fixed: 69776b9

@ghost ghost closed this as completed Aug 14, 2017
@cdkamat
Copy link
Author

cdkamat commented Aug 14, 2017

Thanks for fixing this.

This issue was closed.
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