Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Releases: dtolnay/serde-yaml

0.6.0

29 Jan 19:18
0.6.0
46977b2
Compare
Choose a tag to compare

The new Serde 0.9 error system gives way more helpful error messages:

- Invalid type. Expected `Str`
+ invalid type: string "abc", expected an integer at line 2 column 7

- Missing field `w`
+ missing field `w` at line 2 column 2

- Invalid length: 2
+ invalid length 2, expected a tuple of size 3 at line 2 column 1

- Unknown field: `w`
+ unknown field `w`, expected one of `x`, `y`, `z` at line 14 column 4

0.6.0-rc1

29 Jan 19:11
0.6.0-rc1
8eb0951
Compare
Choose a tag to compare
0.6.0-rc1 Pre-release
Pre-release
Release 0.6.0-rc1

0.5.1

17 Jan 08:03
0.5.1
614ca59
Compare
Choose a tag to compare

0.5.0

14 Oct 06:06
0.5.0
39c7ce8
Compare
Choose a tag to compare

Breaking changes in 0.5.0

  • Real numbers written in YAML are now deserialized through visit_f64 rather than visit_str; this may affect custom Deserialize implementations that expect to process real numbers as strings (#24, thanks @jwilm)
  • serde_yaml::to_writer no longer flushes the writer after writing; the caller is responsible for flushing if necessary (#29, thanks @emk)
  • serde_yaml::Value is no longer the same type as yaml_rust::Yaml
  • Order of map keys is preserved where before they were sorted alphanumerically; this means that deserializing from YAML to serde_yaml::Value and writing back to YAML will preserve the order of keys in the input, and also serializing a struct to YAML will produce keys in the same order as the fields in the struct

Enhancements

The new serde_yaml::Value implements the Serde Serialize and Deserialize traits, similar to serde_json::Value. This allows structs to be deserialized containing values of any type (#23, thanks @andrewrynhard).

#[derive(Serialize, Deserialize)]
pub struct GenericInstructions {
    #[serde(rename = "type")]
    pub typ: String,
    pub config: Value,
}

0.4.1

12 Oct 03:59
0.4.1
Compare
Choose a tag to compare
  • Improve performance of serde_yaml::to_writer by flushing the writer a single time rather than after each token (#28, thanks @emk).

0.4.0

28 Jul 06:58
0.4.0
Compare
Choose a tag to compare

Supports 0.8.x of Serde. No other changes compared to serde_yaml 0.3.0.

0.4.0-rc1

28 Jul 06:58
0.4.0-rc1
Compare
Choose a tag to compare
0.4.0-rc1 Pre-release
Pre-release
Release 0.4.0-rc1

0.3.0

07 Jul 04:01
0.3.0
Compare
Choose a tag to compare

Unit enum variants are now serialized as strings instead of maps (#16)

Consider the following enum:

enum E { V, W }

A map containing keys "v" and "w" and values E::V and E::W used to be serialized as:

v:
  V: []
w:
  W: []

Now it will be serialized as:

v: V
w: W

Deserialization supports both the old and the new format.

This aligns with the corresponding change in serde_json 0.8.0.

0.2.5

07 Jun 16:52
0.2.5
661fccd
Compare
Choose a tag to compare

Supports 0.7.x of Serde.

  • Formatted error messages created by other libraries no longer get replaced with less useful ones (#17)

0.2.4

21 Apr 00:14
0.2.4
Compare
Choose a tag to compare

Supports 0.7.x of Serde.

  • Adds a preserve_order feature flag to preserve order of map entries when reading and writing YAML (#14)