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 MapNone { map val = 1; } message MapMin { map val = 1 [(validate.rules).map.min_pairs = 2]; } message MapMax { map val = 1 [(validate.rules).map.max_pairs = 3]; } message MapMinMax { map val = 1 [(validate.rules).map = {min_pairs: 2, max_pairs: 4}]; } message MapExact { map val = 1 [(validate.rules).map = {min_pairs: 3, max_pairs: 3}]; } message MapNoSparse { map val = 1 [(validate.rules).map.no_sparse = true]; message Msg {} } message MapKeys { map val = 1 [(validate.rules).map.keys.sint64.lt = 0]; } message MapValues { map val = 1 [(validate.rules).map.values.string.min_len = 3]; } message MapKeysPattern { map val = 1 [(validate.rules).map.keys.string.pattern = "(?i)^[a-z0-9]+$"]; } message MapValuesPattern { map val = 1 [(validate.rules).map.values.string.pattern = "(?i)^[a-z0-9]+$"]; } message MapRecursive { map val = 1; message Msg { string val = 1 [(validate.rules).string.min_len = 3]; } } message MapExactIgnore { map val = 1 [(validate.rules).map = {min_pairs: 3, max_pairs: 3, ignore_empty: true}]; } message MultipleMaps { map first = 1 [(validate.rules).map.keys.uint32.gt = 0]; map second = 2 [(validate.rules).map.keys.int32.lt = 0]; map third = 3 [(validate.rules).map.keys.int32.gt = 0]; } message MapKeysIn {map val = 1 [(validate.rules).map.keys.string = {in: ["foo", "bar"]}]; } message MapKeysNotIn {map val = 1 [(validate.rules).map.keys.string = {not_in: ["foo", "bar"]}]; }