From 72e66e2b556e1725a4a4fc87dc423a610ae1f1cc Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Sun, 24 Jun 2018 01:10:19 +0000 Subject: Enable ignore unknown field in json parsing --- upb/json/parser.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'upb/json/parser.h') diff --git a/upb/json/parser.h b/upb/json/parser.h index bcc2c84..3540c53 100644 --- a/upb/json/parser.h +++ b/upb/json/parser.h @@ -38,7 +38,7 @@ UPB_DECLARE_DERIVED_TYPE(upb::json::ParserMethod, upb::RefCounted, class upb::json::Parser { public: static Parser* Create(Environment* env, const ParserMethod* method, - Sink* output); + Sink* output, bool ignore_json_unknown); BytesSink* input(); @@ -72,7 +72,8 @@ UPB_BEGIN_EXTERN_C upb_json_parser* upb_json_parser_create(upb_env* e, const upb_json_parsermethod* m, - upb_sink* output); + upb_sink* output, + bool ignore_json_unknown); upb_bytessink *upb_json_parser_input(upb_json_parser *p); upb_json_parsermethod* upb_json_parsermethod_new(const upb_msgdef* md, @@ -92,8 +93,8 @@ UPB_END_EXTERN_C namespace upb { namespace json { inline Parser* Parser::Create(Environment* env, const ParserMethod* method, - Sink* output) { - return upb_json_parser_create(env, method, output); + Sink* output, bool ignore_json_unknown) { + return upb_json_parser_create(env, method, output, ignore_json_unknown); } inline BytesSink* Parser::input() { return upb_json_parser_input(this); -- cgit v1.2.3