From 706ffdbc658e00fdf0d03715c8306eb7e7b7e963 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 18 Sep 2018 09:53:38 -0700 Subject: Fix json encoding for wrappers, ListValue, Struct and Value. (#126) * Fix json encoding for wrappers, ListValue, Struct and Value. * Add well_known_type field in upb_msgdef to specify type of well known messages. * Remove comma at end of enum definition. * Group number wrappers * Fix comments * Refactoring to use is_wellknown_{msg/field} --- upb/structdefs.int.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'upb/structdefs.int.h') diff --git a/upb/structdefs.int.h b/upb/structdefs.int.h index ff44e2d..cf8bd1d 100644 --- a/upb/structdefs.int.h +++ b/upb/structdefs.int.h @@ -115,6 +115,10 @@ struct upb_msgdef { /* Whether this message has proto2 or proto3 semantics. */ upb_syntax_t syntax; + /* Type of well known type message. UPB_WELLKNOWN_UNSPECIFIED for + * non-well-known message. */ + upb_wellknowntype_t well_known_type; + /* TODO(haberman): proper extension ranges (there can be multiple). */ }; @@ -123,10 +127,11 @@ extern const struct upb_refcounted_vtbl upb_msgdef_vtbl; /* TODO: also support static initialization of the oneofs table. This will be * needed if we compile in descriptors that contain oneofs. */ #define UPB_MSGDEF_INIT(name, selector_count, submsg_field_count, itof, ntof, \ - map_entry, syntax, refs, ref2s) \ + map_entry, syntax, well_known_type, refs, ref2s) \ { \ UPB_DEF_INIT(name, UPB_DEF_MSG, &upb_fielddef_vtbl, refs, ref2s), \ - selector_count, submsg_field_count, itof, ntof, map_entry, syntax \ + selector_count, submsg_field_count, itof, ntof, map_entry, syntax, \ + well_known_type \ } -- cgit v1.2.3