Git Product home page Git Product logo

Comments (7)

skybrian avatar skybrian commented on May 4, 2024

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.

NikolayZherebtsovGoogle avatar NikolayZherebtsovGoogle commented on May 4, 2024

What happened to these constants? Can't see them in the generated files.

from protobuf.dart.

sigurdm avatar sigurdm commented on May 4, 2024

What happened to these constants? Can't see them in the generated files.
They are in the protoname.pbjson.dart file

from protobuf.dart.

sigurdm avatar sigurdm commented on May 4, 2024

@szakarias This will have to be fixed before we can implement proto3 json en-/decoding.

from protobuf.dart.

sigurdm avatar sigurdm commented on May 4, 2024

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.

sigurdm avatar sigurdm commented on May 4, 2024

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.

sigurdm avatar sigurdm commented on May 4, 2024

This should be fixed now.

from protobuf.dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.