Skip to content

Releases: serde-rs/json

v0.9.1

26 Jan 07:25
v0.9.1
69632a6
Compare
Choose a tag to compare
  • Add "encoding" category and CI badge to crates.io

v0.9.0

25 Jan 21:14
v0.9.0
ce49f79
Compare
Choose a tag to compare

This release features a redesigned serde_json::Value enum that better represents the loosely-typed reality of common JSON workflows in Rust. Don't despair - strongly typed Serde serialization and deserialization is still supported of course.

enum Value {
    Null,
    Bool(bool),
    Number(Number),
    String(String),
    Array(Vec<Value>),
    Object(Map<String, Value>),
}

See the documentation for example code, including some examples of indexing into a serde_json::Value in a concise way: jv["address"]["city"].

This release adds a json! macro for building serde_json::Value objects in your program from a very natural JSON syntax.

// The type of `value` is serde_json::Value
let value = json!({
    "code": 200,
    "success": true,
    "payload": {
        "features": [
            "serde",
            "json"
        ]
    }
});

Any expression can be included in the serde_json::Value that you build. This works as long as the type of the expression implements Serde's Serialize trait.

let code = 200;
let features = vec!["serde", "json"];

let value = json!({
   "code": code,
   "success": code == 200,
   "payload": {
       features[0]: features[1]
   }
});

Please read also the Serde 0.9.0 release notes.

v0.9.0-rc3

25 Jan 21:03
v0.9.0-rc3
7370630
Compare
Choose a tag to compare
v0.9.0-rc3 Pre-release
Pre-release
Release 0.9.0-rc3

v0.9.0-rc2

24 Jan 03:47
v0.9.0-rc2
286edcd
Compare
Choose a tag to compare
v0.9.0-rc2 Pre-release
Pre-release
Release 0.9.0-rc2

v0.9.0-rc1

24 Jan 03:47
v0.9.0-rc1
90ed218
Compare
Choose a tag to compare
v0.9.0-rc1 Pre-release
Pre-release
Release 0.9.0-rc1

v0.8.6

18 Jan 22:51
v0.8.6
f853fc9
Compare
Choose a tag to compare
  • Restore support for building with Rust 1.8.0 (#198)

v0.8.5

18 Jan 05:06
v0.8.5
9407642
Compare
Choose a tag to compare
  • Propagate EOF found while checking trailing whitespace (#194, thanks @kchmck)

v0.8.4

07 Dec 05:18
v0.8.4
f0e7626
Compare
Choose a tag to compare
  • Avoid unbounded stack usage by limiting recursion go 128 levels of nesting during deserialization (#163)
  • Add a mutable JSON Pointer method Value::pointer_mut similar to the existing immutable Value::pointer (#171)
  • Allow unit enum variants as map keys when serializing (#172)

v0.8.3

16 Oct 19:40
v0.8.3
d2fa590
Compare
Choose a tag to compare
  • Fix serde_json::to_value(f64::NAN) to return Value::Null instead of Value::F64(NAN). Null is the representation of NaN used elsewhere by serde_json. (#155, thanks @traviskaufman)

v0.8.2

15 Sep 06:53
v0.8.2
b4022a2
Compare
Choose a tag to compare
  • Allow serde_json::to_value to take ownership of its argument, which is more friendly to iterator adapters (#149)
  • Allow io::Write trait objects to be used with serde_json::to_writer and to_writer_pretty (#150)