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

Issue with protoc-gen-validate: Unknown Option "(validate.rules)" Error #1060

Closed
LFool opened this issue Jan 18, 2024 · 1 comment
Closed

Comments

@LFool
Copy link

LFool commented Jan 18, 2024

Description:
I encountered a problem while using protoc-gen-validate.

When I execute the command protoc --go_out=. -I . hello_world.proto --validate_out="lang=go:."

it throws an error hello_world.proto:10:20: Option "(validate.rules)" unknown. Ensure that your proto definition file imports the proto which defines the option.

Directory Structure:

Copy code
├── proto
│   ├── hello_world.proto
│   └── validate.proto

Details:

  • The validate.proto file is copied from protoc-gen-validate.

  • The hello_world.proto file is written by myself, with the following content:

    protobufCopy code
    syntax = "proto3";
    
    package proto;
    
    option go_package="./;proto";
    
    import "validate.proto";
    
    message Person {
        uint64 id = 1 [(validate.rules).uint64.gt = 999];
    }
    
  • I have also successfully installed protoc-gen-validate in the $GOPATH/bin directory following the installation instructions.

image
@chrispine
Copy link
Contributor

Hello, thanks for your interest! As explained in the README, this project is in maintenance mode. We recommend upgrading to protovalidate.

I'm going to go ahead and close this issue, but feel free to open one against protovalidate if needed. Thanks!

@chrispine chrispine closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants