forked from bufbuild/protoc-gen-validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kitchen_sink.proto
42 lines (36 loc) · 2.04 KB
/
kitchen_sink.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 "validate/validate.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
enum ComplexTestEnum {
ComplexZero = 0;
ComplexONE = 1;
ComplexTWO = 2;
}
message ComplexTestMsg {
string const = 1 [(validate.rules).string.const = "abcd"];
ComplexTestMsg nested = 2;
int32 int_const = 3 [(validate.rules).int32.const = 5];
bool bool_const = 4 [(validate.rules).bool.const = false];
google.protobuf.FloatValue float_val = 5 [(validate.rules).float.gt = 0];
google.protobuf.Duration dur_val = 6 [(validate.rules).duration.lt = {seconds: 17}, (validate.rules).duration.required = true];
google.protobuf.Timestamp ts_val = 7 [(validate.rules).timestamp.gt = {seconds: 7}];
ComplexTestMsg another = 8;
float float_const = 9 [(validate.rules).float.lt = 8];
double double_in = 10 [(validate.rules).double = {in: [456.789, 123]}];
ComplexTestEnum enum_const = 11 [(validate.rules).enum.const = 2];
google.protobuf.Any any_val = 12 [(validate.rules).any = {in: ["type.googleapis.com/google.protobuf.Duration"]}];
repeated google.protobuf.Timestamp rep_ts_val = 13 [(validate.rules).repeated = { items { timestamp { gte { nanos: 1000000}}}}];
map<sint32, string> map_val = 14 [(validate.rules).map.keys.sint32.lt = 0];
bytes bytes_val = 15 [(validate.rules).bytes.const = "\x00\x99"];
oneof o {
option (validate.required) = true;
string x = 16;
int32 y = 17;
}
}
message KitchenSinkMessage { ComplexTestMsg val = 1; }