Added --defaults-json to output fields at default value.

Normal behavior is to not output fields that happen to have
the default value, since those will be reproduced anyway
when turned into a FlatBuffer binary. This however can be problematic
when using JSON to interop with other system since they might not
know this default value. This flatc option (and also flag
to GenerateText) will force those fields to be output anyway.

Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2015-05-27 16:42:15 -07:00
parent 788acb08d4
commit ecf5a6a580
4 changed files with 44 additions and 25 deletions

View File

@@ -45,6 +45,9 @@ be generated for each file processed:
in quotes, no trailing commas in tables/vectors). By default, no quotes are
required/generated, and trailing commas are allowed.
- `--defaults-json` : Output fields whose value is equal to the default value
when writing JSON text.
- `--no-prefix` : Don't prefix enum values in generated C++ by their enum
type.