23 Commits

Author SHA1 Message Date
Christian Zangl
52a606f48c add preserve_order feature 2016-06-15 21:16:26 +02:00
Homu
aa427ae1cc Auto merge of #41 - pyfisch:json-pointer, r=erickt
feat(value): implement RFC6901 JSON Pointer

Add a method `pointer(&str)` to `Value`. Deprecate `lookup(&str)`.
Bump version to 0.7.1.

Closes #9

Notes:
* It should be possible to add a `pointer_mut(&str)` method to Value. This would allow to add and modify values. (Maybe even a delete method) I failed to add such a method because of borrow checker.
* Should [RFC6902 JSON Patch](https://tools.ietf.org/html/rfc6902) be implemented or is this something for a separate crate? (Patch is based on Pointer)
2016-05-13 17:41:41 +09:00
David Tolnay
f044792a59 Use indoc for JSON document literals in test 2016-03-19 04:05:13 -07:00
Pyfisch
6fa1af01a8 feat(value): implement RFC6901 JSON Pointer
Add a method `pointer(&str)` to `Value`. Deprecate `lookup(&str)`.
Bump version to 0.7.1.

Closes #9
2016-02-27 16:10:02 +01:00
Erick Tryzelaar
7bc9b0a98e fix(tests): Fix the skeptic tests on stable rust 2016-02-26 22:41:58 -08:00
Erick Tryzelaar
e19a3cc7d5 feat(tests): Add support for skeptic to test readme 2016-02-26 22:06:31 -08:00
Erick Tryzelaar
83c650a819 fix(tests): Update to latest error types 2016-02-26 21:45:24 -08:00
Erick Tryzelaar
7821f5a6d6 fix(error): Fix missing variant/field, rename error variants 2016-02-25 07:45:44 -08:00
Erick Tryzelaar
b309a3e635 Merge branch 'master' into 0.7.x
# Conflicts:
#	json/Cargo.toml
#	json/src/de.rs
2016-02-23 07:51:59 -08:00
Erick Tryzelaar
a3eca5e4e1 refactor(stream): Rename JSONStream to StreamDeserializer
This is a tad more consistent with the rest of the library.
2016-02-23 07:48:15 -08:00
Erick Tryzelaar
979eefe047 Merge branch 'feature-parse-stream' 2016-02-23 07:32:52 -08:00
Erick Tryzelaar
ac7d5d448b feat(testing): Add clippy support 2016-02-23 05:57:30 -08:00
Erick Tryzelaar
b936a41d31 Merge pull request #31 from cmbrandenburg/missing_field_fixes
Fix: Report correct error code for missing field
2016-02-23 05:31:30 -08:00
Joe Wilm
a7c80c1de7 Fix broken things with latest serde
This updates json breakage from latest serde master. Of note is the
removal of `test_missing_fmt_renamed_field` which relied on a feature
that is being removed.

Additionally,

- Adds .cargo/config for travis to use master of serde
- reverts dependencies with specific git revisions
2016-02-10 13:04:40 -08:00
Nathan Lilienthal
a3101d3827 Fix negative zero 2016-02-06 03:51:05 -05:00
Joe Wilm
f6db96aea9 feat(serde-up) Support serde 0.7
Mappings from visit_* to de/serialize_* should be self explanatory.
[serde(deny_unknown_fields)] was added to a test struct since it was
checking for denial. A couple of error types were added to support new
serde de::value::Error variants. Finally, there are a bunch of throwaway
changes pinning the serde version to a 0.7 commit. These should be
removed once 0.7 lands in favor of a crates.io semver spec.
2016-02-01 18:58:09 -08:00
Roma Sokolov
34b3a1e9ce [add] test for empty input 2016-01-30 19:43:19 +00:00
Roma Sokolov
8f62d2f322 [fix] Proper handling of trailing whitespaces 2016-01-30 19:43:08 +00:00
Craig M. Brandenburg
1fca7dbb32 Fix: Report correct error code for missing field
This resolves #22, resolves #29, and resolves #30.

* The reported error code is now `MissingField`, not `ExpectedSomeValue`.
* A missing `()` field now causes a `MissingField` error.
* A missing `Vec<_>` field now causes a `MissingField` error.

Tests have been updated to check these cases.
2016-01-23 05:57:25 -07:00
Roma Sokolov
e54f13c54d Apply review comments:
* `parse_stream` removed in favor of direct `JSONStream` usage;
 * truncated input no longer silently ignored;
 * added test for errors;
 * style violation fixed.
2016-01-13 19:20:32 +00:00
Roma Sokolov
c48345be72 Add helper function to parse stream of json values
Many modern web APIs return their data as stream of (sometimes newline
delimited) JSON values. This commits add handy function `parse_stream`
that returns Iterator over parsed values.
2015-12-12 00:07:12 +00:00
Erick Tryzelaar
53b93605bd Add examples and json byte tests 2015-08-27 20:08:20 -07:00
Erick Tryzelaar
c79213f8a2 Initial import of serde_json 2015-08-24 20:55:33 -07:00