From 13c59cb051c4deee5367f9c5fc7b5d07363496a0 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 4 Dec 2018 15:21:32 -0800 Subject: Implement json decoding for Any message. (#130) * Implement json decoding for Any message. type url may not appear as the first value in json. As a result, other data cannot be resolved before resolving type url. To solve that, this change caches the start and end position of unparsed values and resolve them in end_any_object when type url has been resolved. * Handle Any in switch * Update json parser size * Fix comments * Sync upstream * Add dependency on upb_pb for upb_json * Debug failed test * Fix cmake * Update test generated files * Remove debug tests --- upb/def.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'upb/def.h') diff --git a/upb/def.h b/upb/def.h index 36787cb..c9ed1cf 100644 --- a/upb/def.h +++ b/upb/def.h @@ -285,6 +285,7 @@ typedef enum { */ typedef enum { UPB_WELLKNOWN_UNSPECIFIED, + UPB_WELLKNOWN_ANY, UPB_WELLKNOWN_DURATION, UPB_WELLKNOWN_TIMESTAMP, /* number wrappers */ @@ -1543,6 +1544,8 @@ const upb_def *upb_symtab_resolve(const upb_symtab *s, const char *base, const char *sym); const upb_def *upb_symtab_lookup(const upb_symtab *s, const char *sym); const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym); +const upb_msgdef *upb_symtab_lookupmsg2( + const upb_symtab *s, const char *sym, size_t len); const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym); bool upb_symtab_add(upb_symtab *s, upb_def *const*defs, size_t n, void *ref_donor, upb_status *status); -- cgit v1.2.3