New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement json decoding for Any message. #130
Conversation
upb/json/parser.rl
Outdated
return false; | ||
} | ||
|
||
json_parser_any_frame_set_packed(p, p->top->any_frame, packed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a name other than "packed"? I thought this was somehow related to packed repeated fields. Maybe json_parser_any_frame_set_type()
? And maybe call the variable here any_type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to payload_type.
upb/json/parser.rl
Outdated
upb_json_parser* parser; | ||
upb_sink sink; | ||
|
||
/* Mark the range of unpacked values in json input before type url. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe uninterpreted
instead of unpacked
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -191,6 +191,9 @@ endif | |||
upb_json_SRCS = \ | |||
upb/json/parser.c \ | |||
upb/json/printer.c \ | |||
upb/pb/encoder.c \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't put these sources in more than one library. Instead add dependencies on libupb.pb.a to binaries that need it.
Or help me get Kokoro Bazel tests going, so we can delete the Travis tests and the Makefile completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left this. Will fix it after kokoro fix.
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.
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.