Skip to content
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

protoc-gen-javapgv hasn't been updated to support optional fields in proto3 #495

Closed
nikoncode opened this issue Jul 14, 2021 · 2 comments
Closed
Labels
Stale Activity has stalled on this issue/pull-request

Comments

@nikoncode
Copy link

nikoncode commented Jul 14, 2021

I have following proto file:

syntax = "proto3";

package com.example.demo;

option java_multiple_files = true;

message B {
  optional string a = 1;
}

Build configuration:

    protoc {
        artifact = "com.google.protobuf:protoc:3.17.3"
    }

    plugins {
        javapgv {
            artifact = "io.envoyproxy.protoc-gen-validate:protoc-gen-validate:0.4.1"
        }
    }

    generateProtoTasks {
        all()*.plugins {
            javapgv {
                option "lang=java"
            }
        }
    }
}

I got error on generateProto task:
protoc: stdout: . stderr: B.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-javapgv hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--javapgv_out:

We use optional to detect value presence. And we want to combine both worlds: validation & value presence support.

@akonradi
Copy link
Contributor

See #431

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Activity has stalled on this issue/pull-request label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Activity has stalled on this issue/pull-request
Projects
None yet
Development

No branches or pull requests

2 participants