Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email rule not working on google.protobuf.StringValue #223

Closed
xmlking opened this issue Jun 21, 2019 · 7 comments
Closed

email rule not working on google.protobuf.StringValue #223

xmlking opened this issue Jun 21, 2019 · 7 comments
Labels
Bug Reports and/or fixes a bug Go Go language support GoGo [DEPRECATED] Gogo plugin support [DEPRECATED]

Comments

@xmlking
Copy link

xmlking commented Jun 21, 2019

cannot add email rule on google.protobuf.StringValue but works on string type

getting following error:

m._validateEmail undefined (type *UserRequest has no field or method _validateEmail)

message UserRequest {
	google.protobuf.UInt32Value id = 1 [(validate.rules).uint32.gte = 1];
    google.protobuf.StringValue username = 2 [(validate.rules).string = {
                            min_len: 4
                            max_len: 16
                            pattern:  "^[a-z0-9_-]{3,15}$",
                            max_bytes: 256,
                        }];
    google.protobuf.StringValue firstName = 3 [(validate.rules).string.min_len = 3];
    google.protobuf.StringValue lastName = 4 [(validate.rules).string.min_len = 3];
    // string email = 5 [(validate.rules).string.email = true];
    google.protobuf.StringValue email = 5 [(validate.rules).string.email = true];
  }
@rodaine rodaine added Bug Reports and/or fixes a bug Go Go language support GoGo [DEPRECATED] Gogo plugin support [DEPRECATED] labels Jun 21, 2019
@rodaine
Copy link
Member

rodaine commented Jun 21, 2019

Thanks for the report! This is indeed a bug (the helper method is not being generated in the case of the WKT).

@xmlking
Copy link
Author

xmlking commented Aug 7, 2019

similar issue for uuid validation

m._validateUuid undefined (type *UserRequest has no field or method _validateUuid)
google.protobuf.StringValue id = 1  [(validate.rules).string.uuid = true];

@xmlking
Copy link
Author

xmlking commented Aug 7, 2019

@rodaine wonder if any possibility to get this fixed in next release?

@xmlking
Copy link
Author

xmlking commented Aug 9, 2019

i am using override workaround , hope i can remove this if this is fixed.
https://github.com/xmlking/micro-starter-kit/blob/master/srv/account/proto/account/account.override.go#L45

@xmlking
Copy link
Author

xmlking commented Feb 9, 2020

any update on this ? Thanks

@Anastasiya96
Copy link

Sorry, but why was this completed?

@chrispine
Copy link
Contributor

Please re-open if this is still an issue! (Sorry, I wasn't here when this was originally closed.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reports and/or fixes a bug Go Go language support GoGo [DEPRECATED] Gogo plugin support [DEPRECATED]
Projects
None yet
Development

No branches or pull requests

5 participants