Giter Site home page Giter Site logo

Comments (6)

AyushSingh13 avatar AyushSingh13 commented on June 17, 2024

@setpill Were you able to find a workaround for this?

from prototool.

AyushSingh13 avatar AyushSingh13 commented on June 17, 2024

For anyone stumbling across this, protobuf 3.12 required --experimental_allow_proto3_optional to be passed in for the use of optional but this flag isn't required from 3.15 onwards. If you set the protoc version to 3.15.8 (latest at the time of writing), prototool will automatically download it next time it runs and not throw the error above.

While this doesn't solve the problem of passing flags not supported by prototool to protoc, it does fix the use of optional whilst using prototool.

from prototool.

notxcain avatar notxcain commented on June 17, 2024

@AyushSingh13 do you know any workaround for prototool format?

from prototool.

ccakes avatar ccakes commented on June 17, 2024

@AyushSingh13 do you know any workaround for prototool format?

Also interested in this

from prototool.

sogartar avatar sogartar commented on June 17, 2024

I have noticed that if you specify a newer version (>=3.15) of protoc in prototool.yaml, the verification step that uses protoc will not fail, but the format fixer will remove the optional attributes.
This is rather unfortunate if the fields are of non-message type and in this case optional is necessary. If you don't have optional for example The Python generator would rise an error when testing for presence.

ValueError: Can't test non-optional, non-submessage field "MyType.my_filed" for presence in proto3.

from prototool.

ccakes avatar ccakes commented on June 17, 2024

I did a bit more reading on this and based on some comments in the buf repo it seems like the prototool formatter is lossy and probably not a great idea to use anyway. Once of the reasons they haven't implemented a formatter yet.

It looks they're they're planning to work on one soon so hopefully we get a new formatter to use that supports the optional keyword

from prototool.

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.