Skip to content

Improvements in serde deserializer and MSRV bumped to 1.52

Compare
Choose a tag to compare
@Mingun Mingun released this 25 Dec 12:23
· 547 commits to master since this release

What's Changed

MSRV was increased from 1.46 to 1.52 in #521.

New Features

  • #521: Implement Clone for all error types. This required changing Error::Io to contain
    Arc<std::io::Error> instead of std::io::Error since std::io::Error does not implement
    Clone.

Bug Fixes

  • #490: Ensure that serialization of map keys always produces valid XML names.
    In particular, that means that maps with numeric and numeric-like keys (for
    example, "42") no longer can be serialized because XML name cannot start
    from a digit
  • #500: Fix deserialization of top-level sequences of enums, like
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- list of enum Enum { A, B, С } -->
    <A/>
    <B/>
    <C/>
  • #514: Fix wrong reporting Error::EndEventMismatch after disabling and enabling
    .check_end_names
  • #517: Fix swapped codes for \r and \n characters when escaping them
  • #523: Fix incorrect skipping text and CDATA content before any map-like structures
    in serde deserializer, like
    unwanted text<struct>...</struct>
  • #523: Fix incorrect handling of xs:lists with encoded spaces: they still
    act as delimiters, which is confirmed also by mature XmlBeans Java library
  • #473: Fix a hidden requirement to enable serde's derive feature to get
    quick-xml's serialize feature for edition = 2021 or resolver = 2 crates

Misc Changes

  • #490: Removed $unflatten= special prefix for fields for serde (de)serializer, because:

    • it is useless for deserializer
    • serializer was rewritten and does not require it anymore

    This prefix allowed you to serialize struct field as an XML element and now
    replaced by a more thoughtful system explicitly indicating that a field should
    be serialized as an attribute by prepending @ character to its name

  • #490: Removed $primitive= prefix. That prefix allowed you to serialize struct
    field as an attribute instead of an element and now replaced by a more thoughtful
    system explicitly indicating that a field should be serialized as an attribute
    by prepending @ character to its name

  • #490: In addition to the $value special name for a field a new $text
    special name was added:

    • $text is used if you want to map field to text content only. No markup is
      expected (but text can represent a list as defined by xs:list type)
    • $value is used if you want to map elements with different names to one field,
      that should be represented either by an enum, or by sequence of enums
      (Vec, tuple, etc.), or by string. Use it when you want to map field to any
      content of the field, text or markup

    Refer to documentation for details.

  • #521: MSRV bumped to 1.52.

  • #473: serde feature that used to make some types serializable, renamed to serde-types

  • #528: Added documentation for XML to serde mapping

New Contributors

Full Changelog: v0.26.0...v0.27.0