Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Service arguments parse error #163

Open
lushijie opened this issue Oct 22, 2018 · 2 comments
Open

Service arguments parse error #163

lushijie opened this issue Oct 22, 2018 · 2 comments

Comments

@lushijie
Copy link

// m21.thrift file
struct Code {
  1: string abc
}

// m2.thrift file
include 'm21.thrift'
service Test {
  void ping(m21.Code a);
}

parse error message:

 assert(def.isResult || def.id.value > 0,
                                  ^

TypeError: Cannot read property 'value' of null
    at new ThriftField (/Users/lushijie/github/thrift-json/node_modules/thriftrw/struct.js:40:35)
    at ThriftStruct.compile (/Users/lushijie/github/thrift-json/node_modules/thriftrw/struct.js:122:21)
    at Thrift.compileStruct (/Users/lushijie/github/thrift-json/node_modules/thriftrw/thrift.js:307:11)
@kriskowal
Copy link
Contributor

Thank you for submitting! We should make this error more informative. I believe you need to add a field number to the ping argument. ping(1: m21.Code a).

@lushijie
Copy link
Author

Yes, that's right , Thank you.

Because it's a project long long ago, there are so many style of writing.
When I use thrift 0.11.0 it just throw WARNING like:

[WARNING: /xx/demo/case/m2.thrift:4] No field key specified for a, resulting protocol may have conflicts or not be backwards compatible!

So if thriftrw-node throw warning like thrift would be better .

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants