I have a two thrift files: common.thrift, proto.thrift
content:
common.thrift
namespace java ru.domain.myserv.common
struct MyStruct {
1: i32 val
}
service MyServ {
1: MyStruct myStruct,
2: i32 val
}
proto.thrift
include "common.thrift"
namespace java ru.domain.myserv.proto
typedef ru.domain.myserv.common.MyServ MyServ
struct ProtoServ {
1: MyServ myServ
}
Next, I run the thrift generator:
thrift -r -out ../java --gen java proto.thrift
And I see an errors in console:
[ERROR:/path/proto.thrift:8] (last token was 'ru.domain.myserv.common.MyServ')
Type "ru.domain.myserv.common.MyServ" has not been defined.
What I'm doing wrong?
Oh my God.
I had to specify
typedef common.MyServ MyServ
instead of
typedef ru.domain.myserv.common.MyServ MyServ
But for what then namesapace is necessary?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With