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

Error while importing protos with illegal name '}' #108

Closed
tran302 opened this issue Aug 10, 2019 · 2 comments
Closed

Error while importing protos with illegal name '}' #108

tran302 opened this issue Aug 10, 2019 · 2 comments
Labels
protobuf.js/unsupported Unsupported feature of the underline Protobuf.js parser

Comments

@tran302
Copy link

tran302 commented Aug 10, 2019

We are using proto message with custom validation rules implemented based on https://github.com/envoyproxy/protoc-gen-validate

Below is sample mssage:

syntax = "proto3";
package demo;

service DemoService {
    rpc Demo (DemoRequest) returns (DemoResponse) {}
}
message DemoRequest {
    string number = 1 [(validator.rules).decimal = { }];
}
message DemoResponse {
    string response = 1;
}

Above proto fails to import with error illegal name '}' because there is no specific validation rule defined for (validator.rules).decimal. If I change this to [(validator.rules).decimal = { precision: 1 }], it imports fine.
Could you please support this format?

@rentziass rentziass self-assigned this Sep 20, 2019
@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
@gunturaf
Copy link
Contributor

It looks like that protobufjs/protobuf.js#1256 is already merged long time ago, should we update the protobufjs dependency from 6.8.8 to the latest one 6.11.2 ? I'm happy to create PR for this

@rentziass rentziass removed their assignment Dec 22, 2022
@gh-issue-closer gh-issue-closer bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2023
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