-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 'optional' fields in proto3 #20
Comments
Thanks for letting me know! I'll look into this when I have some time but I can't promise when that will be. |
Hey @huan I just gave this a try and it looks like optional works fine with proto3. Tested with libprotoc 3.15.8. Do you have any more info on what the issue you're hitting is? |
@ckaznocha Thanks for replying to my issue! I'll check for it later this month and come back to you, appreciate your great project, it's very helpful to my project. 👍 |
@ckaznocha Even if @huan hasn't replied yet, could you please make a release so that M1 will work for us? We're currently blocked from using M1 arch until it's released and would really prefer not to release ourselves. |
Oh yes, for sure! |
@tobias- I've changed the way I build releases and don't have an M1 mac to test on but https://github.com/ckaznocha/protoc-gen-lint/releases/download/v0.2.3/protoc-gen-lint_darwin_arm64.zip should work. I'd like to keep the M1 support at #24, If the arm64 doesn't work for you please comment over there and I'll re-open it. |
@ckaznocha I have tried the $ protoc --version
libprotoc 3.18.0
$ go install github.com/ckaznocha/[email protected]
$ protoc -I third-party -I proto --lint_out=. $(find proto/ -type f -name *.proto)
wechaty/puppet/friendship.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-lint hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--lint_out: My message FriendshipAddRequest {
string contact_id = 1;
optional string hello = 2;
optional string source_room_id = 3;
optional string source_contact_id = 4;
} You can reproduce the above problem with my working PR at wechaty/grpc#125 $ git clone [email protected]:wechaty/grpc.git
$ cd grpc/
$ git checkout optional
Branch 'optional' set up to track remote branch 'optional' from 'origin'.
Switched to a new branch 'optional'
$ ./scripts/install-protoc.sh
install skipped: protoc exists
protoc version check: v3.18.0 OK
$ protoc -I third-party -I proto --lint_out=. $(find proto/ -type f -name *.proto)
wechaty/puppet/friendship.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-lint hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--lint_out: |
ping @ckaznocha |
Since [email protected], it started to support
optional
field. It would be nice if theprotoc-gen-ts
plugin supports it. Could you please work on it? Thanks.Here is the reference about how to implement.
This is a blocker for my project wechaty/grpc#109
The text was updated successfully, but these errors were encountered: