Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Error while importing protos: illegal value '[' #115

Closed
xmlking opened this issue Sep 3, 2019 · 4 comments
Closed

Error while importing protos: illegal value '[' #115

xmlking opened this issue Sep 3, 2019 · 4 comments
Labels
protobuf.js/unsupported Unsupported feature of the underline Protobuf.js parser

Comments

@xmlking
Copy link

xmlking commented Sep 3, 2019

Unable to import my proto https://github.com/xmlking/micro-starter-kit/blob/develop/srv/account/proto/account/account.proto

Error: Error while importing protos
illegal value '[' (/micro-starter-kit/srv/account/proto/account/account.proto, line 132)

looks like it doesn't like [(validate.rules).string = {in: ["M", "F"]}];

message ProfileRequest {
    google.protobuf.StringValue id = 1 [(validate.rules).string.uuid = true]; // Not Working
    google.protobuf.StringValue userId = 2 [(validate.rules).string.uuid = true]; // Not Working
    google.protobuf.StringValue tz = 3;
    google.protobuf.StringValue avatar = 4 [(validate.rules).string.uri_ref = true];
    google.protobuf.StringValue gender = 5 [(validate.rules).string = {in: ["M", "F"]}];
    google.protobuf.Timestamp birthday = 6 [(validate.rules).timestamp.lt_now = true];
}
@fenos
Copy link
Contributor

fenos commented Sep 20, 2019

Unfortunately that is a limitation of protobuf.js the issue is tracked from here:
protobufjs/protobuf.js#1256

We are thinking to use a forked version of protobuf.js until this is merged in

@fenos fenos added the protobuf.js/unsupported Unsupported feature of the underline Protobuf.js parser label Sep 20, 2019
@xmlking
Copy link
Author

xmlking commented Sep 20, 2019

protobuf.js last commit is Jun 24
we might has to to fork and use here.

@schaudhary111
Copy link

I am facing the same issue, any workaround or hacks for time being.

@fenos fenos mentioned this issue Feb 13, 2020
@jackielii
Copy link
Collaborator

dup of #96

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
protobuf.js/unsupported Unsupported feature of the underline Protobuf.js parser
Projects
None yet
Development

No branches or pull requests

4 participants