diff options
author | Bo Yang <teboring@google.com> | 2018-12-12 06:34:11 +0000 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2018-12-12 06:34:11 +0000 |
commit | b39dbb9d4010f6b6e11a5100a73e03b601cf72b9 (patch) | |
tree | f94970fb0f0db5b1a456290de59b9a60ca3a0a6a /upb/json/parser.rl | |
parent | 13c59cb051c4deee5367f9c5fc7b5d07363496a0 (diff) |
Add support for encoding Any in json
Diffstat (limited to 'upb/json/parser.rl')
-rw-r--r-- | upb/json/parser.rl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/upb/json/parser.rl b/upb/json/parser.rl index a7bdb3f..e584515 100644 --- a/upb/json/parser.rl +++ b/upb/json/parser.rl @@ -1299,15 +1299,15 @@ static bool end_stringval_nontop(upb_json_parser *p) { return true; } - if (p->top->is_any) { - return end_any_stringval(p); - } - if (p->top->f == NULL) { multipart_end(p); return true; } + if (p->top->is_any) { + return end_any_stringval(p); + } + switch (upb_fielddef_type(p->top->f)) { case UPB_TYPE_BYTES: if (!base64_push(p, getsel_for_handlertype(p, UPB_HANDLER_STRING), |