1234567891011121314151617181920212223242526272829303132333435 |
- 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;
- }
- }
|