Apache Thriftで標準のツリー構造を表現したかったのですが、次の問題が発生しました。
[ERROR:/path_to_project/thrift/service.thrift:31] (last token was 'TCategoryTree')
Type "TCategoryTree" has not been defined.
これらは私の倹約構造です:
struct TCategory {
1: required string name
}
struct TCategoryTree {
1: required TCategory element,
2: optional list<TCategoryTree> children
}
31行目はです2: optional list<TCategoryTree> children
。ここで、現在定義しているのと同じタイプのフィールドを定義します。
Apache Thriftが再帰構造をサポートしていないのでしょうか、それともここで何らかの間違いを犯しているのでしょうか?
編集:私はバージョン0.9.0を使用しています