protoc-gen-validate
protoc-gen-validate copied to clipboard
How to use it?
I have a proto file called user.proto like following
syntax = "proto3";
package user;
import "validate/validate.proto";
option go_package = "pkg/proto/user";
message User {
required string id = 1;
required string name = 2 [
(validate.rules).string.min_len = 2,
(validate.rules).string.max_len = 50
];
}
I am using validate/validate.proto file as mentioned in the official docs here but I seems to get import error like
validate/validate.proto: File not found.
user.proto:5:1: Import "validate/validate.proto" was not found or had errors.
How can I import this??
This is a degradation in v1.0.2. your code used to work for me before latest update (20 hours ago). The file location hasent changed, its still under validate/validate.proto. Try using v1.0.1.
Hello, I am having the same issue on both 1.02 and 1.0.1. Did you manage to resolve it?
@SebastienMelki You need to copy validate/validate.proto
to your repository
I have tried copying the validate/validate.proto
file to my project but I am still getting the same issue. If this is an official step for usage, should this be included in the readme?
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!