json-rust

JSON implementation in Rust

APACHE-2.0 License

Downloads
13.4M
Stars
557
Committers
18

Bot releases are hidden (Show)

json-rust - 0.12.4 Latest Release

Published by maciejhirsz over 4 years ago

  • Fixes an issue with new macros requiring types to be copy.
json-rust - 0.12.3

Published by maciejhirsz over 4 years ago

  • Improved macro syntax:
    • Object "key" => value pair can be now written as either "key": value or key: value without quotes, as long as key is an identifier.
    • If you want to use the value of the a variable as a key in the new notation, use [foo]: value.
    • When nesting objects or arrays, it's no longer necessary to use invoke array! or object! from within another macro.
    • null is a keyword inside of either macro.
    • This is a backwards compatible change, although mixing notations within a single macro invocation is not permitted.

Example

Instead of:

let obj = object! {
    "foo" => array![1, 2, json::Null],
    "bar" => 42
};

You can now write:

let obj = object! {
    foo: [1, 2, null],
    bar: 42
};
json-rust - 0.12.2

Published by maciejhirsz over 4 years ago

  • Fixes #152 & #153.
  • Fixed a whole bunch of warnings and some formatting.
json-rust - 0.12.1

Published by maciejhirsz almost 5 years ago

  • Fixes panics in string generation (#168).
  • Fixes an old link to documentation in doc comments (#170).
json-rust - 0.12.0

Published by maciejhirsz about 5 years ago

  • Updated to edition 2018.
  • Simplified reading escaped unicode in strings a bit.
  • Provided From<&[T]> implementation for JsonValue where T: Into<JsonValue> (closes #160).
  • object! and array! macros will no longer re-allocate (closes #159).
  • object! and array! macros can be now used without being imported into local scope (by using json::object! or json::array!, thanks @matthias-t).
  • BREAKING HashMap and BTreeMap conversions are now more generic, working for any pair of K key and V value where K: AsRef<str> and V: Into<JsonValue>. This means that type inference won't always work in your favor, but should be much more flexible.
  • You can now .collect() an interator of (K, V) (with bounds same as point above) into an Object.
json-rust - 0.11.13

Published by maciejhirsz over 6 years ago

  • Fixes an overflow that lead to a panic in extremely large integers (see issue #139).
json-rust - 0.11.12

Published by maciejhirsz almost 7 years ago

  • Optimized away unnecessary copying in the parser stack machine, should result in parsing performance increased by up to 20%.
json-rust - 0.11.11

Published by maciejhirsz almost 7 years ago

  • Fixes an issue when parsing objects with non-unique names (#136).
  • Fixed a warning on #[must_use] (#119).
  • Deprecated Object::override_last, it was only public out of necessity before pub(crate) was introduced.
json-rust - 0.11.10

Published by maciejhirsz about 7 years ago

Thanks to @Yoric for contributions:

  • Implemented dump and pretty for Object, see #131
  • Two string JsonValues are now equal even if one is a Short while the other is a String variant, see #126
  • The object! macro now handles trailing commas, see #125
json-rust - 0.11.9

Published by maciejhirsz about 7 years ago

  • Numbers created from parts are now automatically normalized, and print out expected values (Issue #114, thanks again @lpbak).
json-rust - 0.11.8

Published by maciejhirsz over 7 years ago

  • Fixed an issue that lead to a panic when trying to print Number types with negative exponent but with large base, where putting the period after first digit would force the scientific e notation to flip sign to positive (issue #108, thank you @lpbak)
json-rust - 0.11.7

Published by maciejhirsz over 7 years ago

  • Fixed an issue with overflow math when turning min value i16 to absolute value u16 (issue #107, thank you @lpbak)
json-rust - 0.11.6

Published by maciejhirsz over 7 years ago

  • Fixes reading out of bounds issue #106.
json-rust - 0.11.5

Published by maciejhirsz over 7 years ago

  • Object struct now implements Index and IndexMut on it's own. Thanks to @hobofan for #105.
  • Fixed a rare SIGSEGV that could occur during serialization or iteration over objects due to invalid lifetimes being applied on unsafe code. Reduced the amount of unsafe code around to increase maintainability of the project, more to come.
json-rust - 0.11.4

Published by maciejhirsz almost 8 years ago

  • To allow for custom implementators of From<T> for JsonValue to benefit from automatic conversions, the trait implementations are now using generics instead of macros internally (see #101).
json-rust - 0.11.3

Published by maciejhirsz almost 8 years ago

  • Fixed an issue where Object and thus JsonValue lacked the Send marker (#100).
json-rust - 0.11.2

Published by maciejhirsz almost 8 years ago

  • Added Eq to derived traits on the Error type.
json-rust - 0.11.1

Published by maciejhirsz almost 8 years ago

  • Added array_remove to JsonValue (see #98).
json-rust - 0.11.0

Published by maciejhirsz almost 8 years ago

  • Breaking change: Error enum now has a new variant: ExceededDepthLimit.
  • Stack overflow issues on deeply nested structures should now be fixed (#93).
    • Parser has been reworked to avoid recursion and instead run in a loop with a custom, heap allocated, stack for nested objects and arrays.
    • As an additional sanity check parsing will now stop after hitting 512 nested objects or arrays and return Error::ExceededDepthLimit.
  • Fixed an issue that caused a panic when unwinding the parser on a single unicode character.
json-rust - 0.10.3

Published by maciejhirsz almost 8 years ago

  • Fixed integer overflow causing a panic when parsing very long exponents.
  • Parser now returns an error on malformatted numbers which are missing a digit after a period (example: [1.]).