summaryrefslogtreecommitdiff
path: root/tests/json/test_json.cc
AgeCommit message (Collapse)Author
2019-04-19Fixed oneof case accessor to cast to enum for C++.Joshua Haberman
2019-03-27Moved macros from upb.h to port_def.inc to avoid leaking them to users. (#160)Joshua Haberman
* Use port_def.inc to prevent macros from leaking to users. * Added helpful comments to port_def.inc/port_undef.inc.
2019-01-15All tests pass again!Joshua Haberman
2019-01-14WIP.Joshua Haberman
2019-01-12A lot more tests are working now.Joshua Haberman
2019-01-09upb_refcounted is gone! Some tests still to fix.Joshua Haberman
2018-12-17test_json is working!Josh Haberman
2018-12-04Implement json decoding for Any message. (#130)Paul Yang
* 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
2018-06-27Enable ignore unknown field in json parsingBo Yang
2016-04-19Changed schema for JSON test to be defined in a .proto file. (#54)Joshua Haberman
* Changed schema for JSON test to be defined in a .proto file. Before we had lots of code to build these schemas manually, but this was verbose and made it difficult to add to the schema easily. Now we can just write a .proto file and adding fields is easy. To avoid making the tests depend on upbc (and thus Lua) we check in the generated schema. * Made protobuf-compiler a dependency of "make genfiles." * For genfiles download recent protoc that can handle proto3. * Only use new protoc for genfiles.
2016-04-14JSON parser: always accept both name variants, flag controls which we generate.Joshua Haberman
* JSON parser: always accept both name variants, flag controls which we generate. My previous commit was based on wrong information about the proto3 JSON spec. It turns out we need to accept both field name formats all the time, and a runtime flag should control which we generate. * Documented the preserve_proto_fieldnames option. * Fix bugs in PR.
2016-02-17Changed JSON parser/printer to correctly camelCase names.Josh Haberman
2015-08-14Added lots of decoder tests and fixed lots of bugs.Josh Haberman
2015-07-30Changed parser semantics around skipping.Josh Haberman
Prior to this change: parse(buf, len) -> len + N ...would indicate that the next N bytes of the input are not needed, *and* would advance the decoding position by this much. After this change: parse(buf, len) -> len + N parse(NULL, N) -> N ...can be used to achieve the same thing. But skipping the N bytes is not explicitly performed by the user. A user that doesn't want/need to skip can just say: parsed = parse(buf, len); if (parsed < len) { // Handle suspend, advance stream by "parsed". } else { // Stream was advanced by "len" (even if parsed > len). } Updated unit tests to test this new behavior, and refactored test utility code a bit to support it.
2015-07-07Brought into compliance with Google open-source policies.Josh Haberman
- removed myself from Author headers in source files. - removed copyright notices from source file headers. - added CONTRIBUTING.md
2015-05-08Merge from open-source development.Josh Haberman
2015-05-08Google-internal development.Josh Haberman
2015-05-06Resolve compilation errors if compiled with more stringent semantic checks.Martin Maly
Adding Travis test to build with strict warnings. Fixing a warning in a test which used signed/unsigned integer comparison.
2015-02-02Support maps in JSON parsing and serialization.Chris Fallin
This is a sync of our internal developing of JSON parsing and serialization. It implements native understanding of MapEntry submessages, so that map fields with (key, value) pairs are serialized as JSON maps (objects) natively rather than as arrays of objects with 'key' and 'value' fields. The parser also now understands how to emit handler calls corresponding to MapEntry objects when processing a map field. This sync also picks up a bugfix in `table.c` to handle an alloc-failed case.
2015-01-07Changes from Google-internal development.Josh Haberman
* JSON parser expanded to handle split buffers. * bugfix to the protobuf decoder.
2014-12-09JSON test, symbolic enum names in JSON, and a few improvements.Chris Fallin
- Added a JSON test that round-trips (parses then re-serializes) several test messages, ensuring that the re-serialized form matches the original exactly. - Added support for printing and parsing symbolic enum names (rather than integer values) in JSON. - Updated JSON printer to properly handle string fields that come in multiple pieces. ('bytes' fields still do not support this, and this work is more challenging because it requires making the base64 encoder resumable. Base64 encoding is not separable at an input-byte granularity, unlike string escaping.) - Fixed a < vs. <= bug in UTF-8 encoding generation (oops).
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback