Reputation: 3405
I want to write a Thrift function which outputs a list. But, there is no such datatype in Thrift. Also, the list datatype in Thrift takes only a single datatype. How do I solve this problem?
Upvotes: 3
Views: 354
Reputation: 1
try something like this
union TAttributeValue {
1: string stringValue,
2: i32 intValue,
3: double doubleValue,
4: bool boolValue
}
struct TRequest {
1: list<TAttributeValue> items
}
Upvotes: 0
Reputation: 101
Make container (struct) whose members are optional and have possible data types in thrift. Then, make list of that struct. It is not beautiful solution, but it works.
Upvotes: 0