Commit 2e2063cb authored by schoetbi's avatar schoetbi Committed by Wouter van Oortmerssen

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
parent 625c9898
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment