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

Option value parsing is only supported partially #1743

Closed
NikhilVerma opened this issue Jun 13, 2022 · 0 comments · Fixed by #1744
Closed

Option value parsing is only supported partially #1743

NikhilVerma opened this issue Jun 13, 2022 · 0 comments · Fixed by #1744

Comments

@NikhilVerma
Copy link
Contributor

protobuf.js version: 6.11.3

Options parsing is not complete and it misses out on nested options and nested field options here is an example proto which fails

syntax = "proto3";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
  info: {
    title: "Some info"; // this fails
    version: "0";
  };
  host: "some.host";
};

message triggerRequest {
  actionType action = 1 [ (validate.rules).enum = {
    defined_only: true,
    not_in: [ 0 ] // this fails
  } ];
}
/protobufjs/src/parse.js:96
        return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")");
               ^
Error: illegal name ';' (my.proto, line 20)
    at illegal (/protobufjs/src/parse.js:96:16)
    at parseOptionValue (/protobufjs/src/parse.js:595:27)
    at parseOptionValue (/protobufjs/src/parse.js:604:33)
    at parseOption (/protobufjs/src/parse.js:585:27)
    at parse (/protobufjs/src/parse.js:783:17)
    at process (/protobufjs/src/root.js:127:30)
    at /protobufjs/src/root.js:194:17
    at fetchReadFileCallback (/@protobufjs/fetch/index.js:51:19)
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
@NikhilVerma NikhilVerma changed the title Option value parsing is only partial Option value parsing is only supported partially Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant