My understanding is that root type is some legacy thing, it is needed only for two reasons:
- root_type name (name, not content) is used to create some objects, for example embed binary schema.
- some syntax sugar API is generated only for root type. Since it is just sugar, you don't have to use it.
Am I right or am I missing something?
So for example if I do:
table Foo { ... }
table Bar {...}
...
// empty root at the end to make flatbuffers happy
table Fbs {}
root_type Fbs
I named it Fbs
so that generated schema looks nice: FbsBinarySchema
.
Another option would be to use file name, since it contains binary schema of full file, and thus MyFileBinarySchema
makes sense.