我的flatbuffers模式中有一个联合类型:
union Quux { Foo,Bar,Baz }
table Root {
quux: Quux
}
如果我使用flatc转换为json,则如下所示:
{
quux_type: "Bar",quux: {...}
}
但是如果我使用flatBufferToString
中的flatbuffers/minireflect.h
,那么我得到的是无效的JSON。
{
quux_type: Bar,quux: {...},}
我这样打电话给flatc
flatc --reflect-names --cpp -o include src/quux.fbs
如何获得minireflect来为联合类型生成有效的json输出?