Hi,
I am evaluating FlatBuffers for my need. I have a well defined data model but it has specific areas that are expected to be completely optional as it is user defined. I treat it like a Map or a Key/Value pair that I don't deserialize further. How do I do this using FlatBuffers? The following doesn't work:
monsterdata.json
----------------------
{
pos: {
x: 1,
y: 2,
z: 3
},
hp: 80,
name: "MyMonster",
version: 2.3,
extras: {
moo:"foo"
}
}
monster.fbs (schema)
----------------------------
table Extra {
}
table Monster {
pos:Vec3;
mana:short = 150;
hp:short = 100;
name:string;
friendly:bool = false (deprecated);
inventory:[ubyte];
color:Color = Blue;
version:float;
extras:Extra;
}
root_type Monster;
$ flatc -b monster_extra.fbs monsterdata.json
Error: monsterdata.json:11:0: error: unknown field: moo
Thanks for the help in advance.
Best, Sameer