forked from bufbuild/protoc-gen-validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneofs.proto
35 lines (29 loc) · 793 Bytes
/
oneofs.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
syntax = "proto3";
package tests.harness.cases;
option go_package = "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go;cases";
import "validate/validate.proto";
message TestOneOfMsg {
bool val = 1 [(validate.rules).bool.const = true];
}
message OneOfNone {
oneof o {
string x = 1;
int32 y = 2;
}
}
message OneOf {
oneof o {
string x = 1 [(validate.rules).string.prefix = "foo"];
int32 y = 2 [(validate.rules).int32.gt = 0];
TestOneOfMsg z = 3;
}
}
message OneOfRequired {
oneof o {
option (validate.required) = true;
string x = 1;
int32 y = 2;
int32 name_with_underscores = 3;
int32 under_and_1_number = 4;
}
}