@@ -100,12 +100,15 @@ static void Error(const std::string &err, bool usage, bool show_exe_name) {
100100 " no trailing commas in tables/vectors.\n "
101101 " --defaults-json Output fields whose value is the default when\n "
102102 " writing JSON\n "
103+ " --unknown-json Allow fields in JSON that are not defined in the\n "
104+ " schema. These fields will be discared when generating\n "
105+ " binaries.\n "
103106 " --no-prefix Don\' t prefix enum values with the enum type in C++.\n "
104107 " --scoped-enums Use C++11 style scoped and strongly typed enums.\n "
105108 " also implies --no-prefix.\n "
106109 " --gen-includes (deprecated), this is the default behavior.\n "
107110 " If the original behavior is required (no include\n "
108- " statements) use --no-includes.\n "
111+ " statements) use --no-includes.\n "
109112 " --no-includes Don\' t generate include statements for included\n "
110113 " schemas the generated file depends on (C++).\n "
111114 " --gen-mutable Generate accessors that can mutate buffers in-place.\n "
@@ -155,6 +158,8 @@ int main(int argc, const char *argv[]) {
155158 opts.skip_js_exports = true ;
156159 } else if (arg == " --defaults-json" ) {
157160 opts.output_default_scalars_in_json = true ;
161+ } else if (arg == " --unknown-json" ) {
162+ opts.skip_unexpected_fields_in_json = true ;
158163 } else if (arg == " --no-prefix" ) {
159164 opts.prefixed_enums = false ;
160165 } else if (arg == " --scoped-enums" ) {
0 commit comments