Skip to content

Commit

Permalink
Validation for enum values (#46)
Browse files Browse the repository at this point in the history
* update

* Added enum validation

* fixed the tests for enum validation
  • Loading branch information
florinutz authored and Michal Witkowski committed Feb 12, 2019
1 parent 0950a79 commit 1f38828
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 90 deletions.
107 changes: 107 additions & 0 deletions examples/enum.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions examples/enum.proto
@@ -0,0 +1,13 @@
syntax = "proto3";
package validator.examples;
import "github.com/mwitkow/go-proto-validators/validator.proto";

message SomeMsg {
Action do = 1 [(validator.field) = {is_in_enum : true}];
}

enum Action {
ALLOW = 0;
DENY = 1;
CHILL = 2;
}
34 changes: 34 additions & 0 deletions examples/enum.validator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

131 changes: 91 additions & 40 deletions examples/nested.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 9 additions & 20 deletions examples/nested.validator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f38828

Please sign in to comment.