From 2e2063cbeb6ea95c804796c443153f71797c3629 Mon Sep 17 00:00:00 2001 From: schoetbi Date: Wed, 19 Jul 2017 17:58:48 +0200 Subject: [PATCH] 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 --- src/idl_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 2cce51945..a7468d55b 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -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) {