Comments (7)
It's not quite what you want, but the field names and other data from the original DescriptorProtos are available via $json constants in 0.4.1.
See these two CL's:
dart-archive/dart-protoc-plugin@fc968d3
dart-archive/dart-protoc-plugin@f4a0f18
from protobuf.dart.
What happened to these constants? Can't see them in the generated files.
from protobuf.dart.
What happened to these constants? Can't see them in the generated files.
They are in theprotoname.pbjson.dart
file
from protobuf.dart.
@szakarias This will have to be fixed before we can implement proto3 json en-/decoding.
from protobuf.dart.
Looking into this it seems that the right thing is to use the FieldDescriptorProto.jsonName instead of our own mangled name.
That indeed is converted to camelcase, but with slightly different disambiguations from when we make dart names.
That makes our job simple.
from protobuf.dart.
Reading more we might need both names:
https://developers.google.com/protocol-buffers/docs/proto3#json_options
Proto3 JSON parsers are required to accept both the converted lowerCamelCase name and the proto field name.
Also textProto requires the proto field name.
That seems to be expensive in terms of size of the compiled program. Will have to consider this further...
from protobuf.dart.
This should be fixed now.
from protobuf.dart.
Related Issues (20)
- Unknown Fields HOT 12
- How do you generate via buf? HOT 2
- Error: Couldn't find constructor 'GrpcServiceName'. HOT 8
- Generate nullable types from WKT wrappers HOT 1
- Bad state: No element HOT 3
- GeneratedMessage constructors with `result` parameter conflict with `result` local var. HOT 1
- toProto3Json converts Int64 values to strings HOT 1
- Impossible to distinguish the `oneof` fields from non-`oneof` fields when creating/using a generated class instance. HOT 4
- How to access google.protobuf.FieldOptions extensions? HOT 1
- Prohibit ..deepCopy() call HOT 1
- Generated gRPC client method stubs get no comments or deprecation annotations HOT 1
- Incompatibility with Java-generated Serialized Protocol Buffer in Dart Protocol Buffers Library
- `protoc` does not generate built-in types HOT 1
- The `.values` field of a generated enum class contains the zero-valued unspecified value HOT 1
- Inconvenient to add an alternate name to each enum value using Enum Value Options
- [protoc_plugin] Error `The method '$_clearField' isn't defined for the class 'DartMixin'.` HOT 1
- [protoc_plugin] Plugin output is unparseable HOT 1
- Error: A value of type 'List<dynamic>' can't be returned from the function 'symbol' because it has a return type of 'PbList<ProtoOALightSymbol>'
- Error "The named parameter 'valueDefaultOrMaker' isn't defined." in version 21.1.2 (protoc 26.1) HOT 3
- Add iOS privacy manifest HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf.dart.