Giter VIP home page Giter VIP logo

Comments (4)

ctaggart avatar ctaggart commented on June 27, 2024

Why is it not possible to write self-describing services in .NET for Protocol Buffers v3? What do you mean by self-describing services? Do you mean code-first with attributes like:
https://github.com/mgravell/protobuf-net#1-first-decorate-your-classes

from froto.

jhugard avatar jhugard commented on June 27, 2024

Have in mind to create a service registration protocol which allows a generic service to register it's FileDescriptorProto (or Set) at run-time, so that the service's metadata can be inspected as well as to provide transcoding from/to JSON, without recompiling the server being registered with. That's what I meant by "self-describing services".

The official C# generator from Google will not generate code for proto2, but proto2 is required if one wants to define and process custom options in .NET. So... I am hunting for an alternative.

from froto.

ctaggart avatar ctaggart commented on June 27, 2024

I had to read up more about custom options. I have't used them, but they could be useful for altering the code generation. It looks to me like you can put custom options in a proto3 descriptor. Did I miss something?

https://developers.google.com/protocol-buffers/docs/proto#options
https://developers.google.com/protocol-buffers/docs/proto3#options
https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto#L35-L37

from froto.

jhugard avatar jhugard commented on June 27, 2024

Hah. What you missed is that while custom options can be used in proto3, they require proto2 syntax to define (custom options use the extend keyword, which is proto2 only). Further, the Google C# code generator only supports generating proto3 constructs, so while it will recognize custom options, it will not generate code to access them. :P

from froto.

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.