idl_parser.cpp ignores $schema in input json (#4382)
* idl_parser.cpp ignores $schema in input json #4381 * idl_parser.cpp: Fixed ci error signed unsigned comparison * idl_parser.cpp: replaced case insensitive search for $schema with case sensitive search * idl_parser.cpp: Expecting a string constant after $schema #4382
This commit is contained in:
parent
625c989875
commit
2e2063cbeb
|
@ -914,6 +914,10 @@ CheckedError Parser::ParseTable(const StructDef &struct_def, std::string *value,
|
|||
size_t fieldn = 0;
|
||||
auto err = ParseTableDelimiters(fieldn, &struct_def,
|
||||
[&](const std::string &name) -> CheckedError {
|
||||
if (name == "$schema") {
|
||||
EXPECT(kTokenStringConstant);
|
||||
return NoError();
|
||||
}
|
||||
auto field = struct_def.fields.Lookup(name);
|
||||
if (!field) {
|
||||
if (!opts.skip_unexpected_fields_in_json) {
|
||||
|
|
Loading…
Reference in New Issue