38 ms·
> Message field names are mapped to lowerCamelCase Why is a mapping to camel case necessary? I imagine it creates the potential for collisions, no?
by caust1c 11y ago
> Message field names are mapped to lowerCamelCase
Why is a mapping to camel case necessary? I imagine it creates the potential for collisions, no?
- haberman 11y agoI think this may be to maintain style conventions with JavaScript and previous versions of Google Cloud APIs which were all based in lowerCamelCase (not 100% sure though, don't quote me on this). A benefit of this decision is that if you create JSON manually in JavaScript (ie. without a protobuf library) your JSON objects will match JavaScript conventions.
- iagooar 11y agoIt's called "sadCamelCase", as opposed to "HappyCamelCase" ;)
- wora 11y agoCo-author of proto3 here. The reasons we chose lowerCamelCase are compatibility with Google's REST APIs (like Gmail API) and readability for users who work with JSON output directly without client library. API designers should not define confusing data schemas, let alone allow collisions. Most proto messages have small number of fields, avoiding name collision is a trivial for an API designer.