forked from bufbuild/protoc-gen-validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.proto
42 lines (33 loc) · 1.22 KB
/
messages.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
syntax = "proto3";
package tests.harness.cases;
option go_package = "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go;cases";
import "tests/harness/cases/other_package/embed.proto";
import "validate/validate.proto";
message TestMsg {
string const = 1 [(validate.rules).string.const = "foo"];
TestMsg nested = 2;
}
message MessageNone {
NoneMsg val = 1;
message NoneMsg {}
}
message MessageDisabled {
option (validate.disabled) = true;
uint64 val = 1 [(validate.rules).uint64.gt = 123];
}
message MessageIgnored {
option (validate.ignored) = true;
uint64 val = 1 [(validate.rules).uint64.gt = 123];
}
message Message { TestMsg val = 1; }
message MessageCrossPackage { tests.harness.cases.other_package.Embed val = 1; }
message MessageSkip { TestMsg val = 1 [(validate.rules).message.skip = true];}
message MessageRequired { TestMsg val = 1 [(validate.rules).message.required = true]; }
message MessageRequiredButOptional { optional TestMsg val = 1 [(validate.rules).message.required = true]; }
message MessageRequiredOneof {
oneof one {
option (validate.required) = true;
TestMsg val = 1 [(validate.rules).message.required = true];
}
}
message MessageWith3dInside {}