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

Extensions inside the scope of the extension's field type fails #657

Closed
chabb opened this issue Jan 24, 2017 · 5 comments
Closed

Extensions inside the scope of the extension's field type fails #657

chabb opened this issue Jan 24, 2017 · 5 comments
Labels

Comments

@chabb
Copy link

chabb commented Jan 24, 2017

protobuf.js version: 6.6.1

I apologized for my weak english.

Google doc says that this is a common pattern :

message Baz {
  extend Foo {
    optional Baz foo_ext = 127;
  }
  ...
}

I have a proto build following this pattern that seems to fool pbjs when using -t static. With -t json, it works fine...

message CompletionRequest {

  extend common.RpcBlog { optional CompletionRequest rpc_id = 1145; }

 // there are some more fields
 // ... 
}

Here is the stack

Error: unresolvable field type: CompletionRequest
    at Error (native)
    at Field.resolve (/Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/src/field.js:229:19)
    at /Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/cli/targets/static.js:290:15
    at Array.forEach (native)
    at buildType (/Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/cli/targets/static.js:289:22)
    at buildNamespace (/Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/cli/targets/static.js:106:9)
    at /Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/cli/targets/static.js:123:13
    at Array.forEach (native)
    at buildNamespace (/Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/cli/targets/static.js:119:20)
    at /Users/francois.chabbey/thoughtspot/blink/node_modules/protobufjs/cli/targets/static.js:123:13


@chabb chabb changed the title extensions inside the scope of the extension's field type Extensions inside the scope of the extension's field type fails Jan 24, 2017
@dcodeIO
Copy link
Member

dcodeIO commented Jan 24, 2017

Hard to tell, the error refers to ValidateContextRequest. Do you have additional context - or could you maybe provide a minimal failing .proto file for reference? That would be perfect.

@chabb
Copy link
Author

chabb commented Jan 24, 2017

Thanks for your response.. i'll come back tomorrow with a small example.. I corrected the above stacktrace

@chabb
Copy link
Author

chabb commented Jan 25, 2017

So this works

node ./node_modules/protobufjs/bin/pbjs -t static ./test.proto
message Foo {
  extensions 100 to 199;
}

message Baz {
  extend Foo {  optional Baz bar = 126; }

  optional int32 request_call_id = 2;
}

Now the issue is that i have biggest proto, that i have not written myself.. and in that case it fails, the issue comes frome the extend .. part. If i remove this part, the pbjs runs successfully.

I will try to come with a reproductible example that fails

@dcodeIO
Copy link
Member

dcodeIO commented Jan 25, 2017

Might be related: #595

@dcodeIO dcodeIO added the unsure label Jan 26, 2017
@dcodeIO
Copy link
Member

dcodeIO commented Jan 30, 2017

Closing this issue for now as it hasn't received any replies recently. Feel free to reopen it if necessary!

@dcodeIO dcodeIO closed this as completed Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants