Having binary data of serialized object monster
, where monster
type is:
table Monster {
name:string;
color:Color;
weapon:Weapon; <--- serialize to json only this, discard other properties
}
can I directly transform only weapon
to json and discard other fields?
Note my binary data is of type Monster
. It seems like the only way to serialize weapon
is to build separate Weapon
object from monster->weapon
by recursively copying all properties and then calling json serialization functions.
--gen-object-api
WeaponT
class and other *T
classesmonster->weapon()->UnpackTo(..)
method to populate WeaponT
instanceWeapon::Pack(fbb, &weaponT)
to serialize back on a new fbb objectGenerateText
on fbb object created in a last step