Update Rust crate serde-saphyr to v2 #15

Merged
kglitchy merged 1 commit from renovate/serde-saphyr-2.x into main 2026-12-02 06:39:36 +00:00
Collaborator

This PR contains the following updates:

Package Type Update Change
serde-saphyr dependencies major 0.0.29 → 2.0.0

Release Notes

bourumir-wyngs/serde-saphyr (serde-saphyr)

v2.2.0

Compare Source

Added
  • Added opt-in Options::null_as_string (default: false) to preserve plain
    null, Null, NULL, ~, and empty scalars as text for string targets in both
    mapping keys and values, including String, &str, and Cow<str>
    (#​267). Explicit !!null
    tags remain rejected for strings; Option<T>, untyped null inference, mapping-key
    comparison, and no_schema quoting requirements keep their existing behavior.
  • Added Options::bom_inside_document_as_content (default false) to preserve a
    BOM at the start of a token inside a document as plain scalar content, including
    in included YAML. A BOM in a document prefix is still skipped.
Fixed
  • Preserve uppercase radix prefixes (0X, 0O, 0B, including signed forms) as
    strings during implicit type inference, including untagged enums and flattened
    fields (#​266). Direct typed integer parsing, explicit !!int tags, and mapping-key
    comparison retain their existing behavior.
  • Infer plain signed not-a-number spellings (+.nan, -.NaN, -.NAN) as strings
    during implicit type inference, since the YAML 1.2 Core schema allows a sign on
    .inf only (#​271; #​272,
    #​273). This applies under
    every NonFiniteFloatPolicy, including untagged enums and flattened fields.
    Also accept these spellings without quotes when no_schema: true for string
    values and mapping keys, including String, &str, and Cow<str>. Direct
    untagged float targets continue to accept them as NaN. Explicit !!float scalars
    now preserve the supplied NaN sign when deserialized as floats.
Changed
  • Updated to granit-parser 2.2.0. Under-indented quoted scalar continuations in block
    context and tabs before quoted continuations are now accepted by default;
    strict_indentation: true continues to reject them.

v2.1.1

Compare Source

Fixed
  • Fixed 2.1.0 regression empty documents producing errors (#​265). Empty document is a valid YAML document.
Performance improvements
  • Significantly reduced allocations when deserializing (#​262)

v2.1.0

Compare Source

Added
  • Added PropertySyntax::DockerComposeWithNulls: Compose interpolation where a value that is
    solely a reference to an unset property, or whose expansion is null/~, becomes YAML null.
    Explicitly empty properties and empty defaults stay empty strings, and DockerCompose itself
    is unchanged.
  • Added opt-in Options::reject_tagged_field_names to catch misplaced tags on
    struct field names, with Error::TaggedStructFieldName diagnostics. Struct field names can
    only be strings, !!str is still accepted. As other tags can only be ignored, tag on a structure
    field name is almost for sure placed wrongly. This setting will be default in next major release.
  • Added Options::leading_zero_numbers_as_strings and
    Options::underscored_numbers_as_strings to preserve numeric spellings such as
    0755 and 1_000 as strings in untyped values, including untagged enums and
    flattened fields (#​225).
    Both default to false; direct typed parsing, explicit numeric tags, and
    mapping-key comparison keep their existing behavior.
  • Added Error::render_to to append diagnostics to any std::fmt::Write using
    RenderOptions, without collecting the complete output in an intermediate string
    (#​221).
  • Added DuplicateKeyPolicy::PassThrough to delegate repeated explicit mapping entries
    to Serde visitors, matching serde_yaml's handling for structs, standard maps, and custom
    multimap visitors (#​226).
    The default remains Error; merge expansion retains its precedence rules. See the README
    migration note for the scope of this option.
Deprecated
  • Deprecated SerializerOptions::empty_as_braces. Setting it to false emits YAML null
    for empty block collections without tags or anchors. These values do not round-trip into
    collection types. Omit the setting to keep the default true and emit [] or {}.
    Existing serialization behavior remains supported for compatibility.
Fixed
  • Preserve application-tagged null-like documents in multi-document APIs, including
    the garde and validator integrations. A document such as !Maybe null now reaches
    enum dispatch instead of being skipped. This also affects default options: an
    Option<String> target receives a None item for !Foo null, while a String target
    reports NullIntoString. Untagged null documents and explicit !!null are still skipped.
  • Resolve tagged enum payloads according to their target type under no_schema:
    !Number 42 can deserialize into a numeric payload, while a string payload still
    requires quoting, as in !Text "42". This applies independently of property interpolation.
  • Keep validated and ordinary multi-document APIs consistent for interpolated nulls
    and interpolation work budgets. Reader iterators stop after an interpolation-budget
    breach, including breaches reported through an alias.
  • Emit empty lines in literal and folded block scalars without indentation,
    avoiding trailing whitespace while preserving whitespace in the string content
    (#​249).
  • Expose the original std::io::Error from deserialization failures through
    std::error::Error::source(). The outer message is IO error, so error chains
    include the underlying cause only once. Standalone Miette, Figment, and Figment2
    diagnostics retain the cause in their messages. Custom Miette formatters retain
    control over the complete message through MessageFormatter::format_standalone_message.
  • Avoid duplicate messages from Error::WithSnippet when following
    std::error::Error::source() by forwarding the wrapped error's source.
    Use without_snippet() to inspect the wrapped error. Alias errors retain their
    complete source chain, including snippet wrappers, for compatibility.
  • Validate recognized scalar tags consistently for numeric, boolean, character,
    and enum targets, including externally tagged enum mapping keys (#​235).
    Incompatible tags and tagged null-like payloads no longer bypass validation.
  • Apply enabled robotics conversions to untyped reads, skipped fields, and
    flattened values. The local !time duration tag is distinct from standard YAML
    !!timestamp; robotics tags require the feature and angle_conversions: true.
  • Reject YAML null when deserializing sequences, mappings, and mapping-based structs instead
    of silently constructing empty values (#​233).
    Blank values and the plain spellings ~, null, Null, and NULL are handled consistently.
    Write [] for an empty sequence or {} for an empty mapping. Option<T> null handling
    and defaults for absent fields are unchanged; see the README migration notes.
  • Tags selecting unit enum variants now reject non-null payloads instead of silently
    discarding them (#​236). Use a bare variant name, a tag with empty content, or a
    tag followed by ~ or null; quoted strings and collections are rejected.
  • Recognize only the standard plain null spellings: empty, ~, null, Null, and NULL.
    Other capitalization such as NulL remains a string instead of being rejected, converted
    to an empty value, or skipped as a document (#​234).
  • strict_booleans: true now recognizes only the six YAML 1.2 Core boolean spellings.
    Other capitalization such as tRuE remains a string during inference, is accepted
    as unquoted text with no_schema, and is rejected for boolean targets.
  • Recognize only the YAML 1.2 Core spellings of .inf and .nan during inference (#​254).

v2.0.0

Compare Source

YAML changes
  • Composite mapping keys are not compared regardless of entry order (thanks @​yuxi-liu-wired) .
  • Commented now writes its output replacing characters not allowed in comments (non printable) by spaces.
Added
  • Added public path_map::PathKind, PathKey::segments(), and PathMap::locations_for()
    for inspecting validation paths and resolving their YAML use/definition locations,
    including best-effort spelling matches and recorded ancestor/root fallback.
  • Added RenderOptions::line_offset and RenderOptions::source_name for displaying
    embedded YAML diagnostics at their containing document's line numbers and naming
    the root source in snippet headers, including the new
    miette::to_miette_report_with_options entry point. Included files retain their own
    names and coordinates, and stored error locations and spans are unchanged.
  • Added PropertySyntax::DockerCompose for Compose-compatible property interpolation.
  • Added the default-enabled comments feature, forwarding to granit-parser's matching
    feature. Builds with default-features = false must enable it to use Commented<T>,
    CommentPosition, comment options, or comment budget fields and reports. Without it,
    YAML comments are still accepted and validated, but their text is not retained.
  • Added Options::non_finite_float_policy with NonFiniteFloatPolicy::{PassThrough, Reject, AsString}
    to configure non-finite floats delivered through deserialize_any. Explicit policies override
    the legacy boolean; leaving the field unconfigured preserves its behavior.
  • Added the borrowed_context example showing recursive Serialize adapters that borrow
    an existing value tree and per-call formatting context, composing with Tagged<T> and
    style wrappers without building a second container tree or using thread-local state.
  • Added SerializerOptions::no_lang_directive (default false) to suppress the
    %YAML 1.2 directive and its leading --- marker independently of yaml_12's quoting.
  • Added from_str_multiple, from_bytes_multiple, and their _with_options variants to
    deserialize multiple YAML documents into any C: Default + Extend<T>, including vectors,
    queues, sets, and custom accumulators. Values can borrow from the input string or UTF-8 byte
    slice. Explicit type arguments specify both the document and collection types, for example
    from_str_multiple::<String, Vec<_>>(input).
  • Added an error: Box<Error> field to Error::AliasError, which keeps the original error
    when an aliased value fails to deserialize. A custom MessageFormatter or Localizer
    now applies to that error, and std::error::Error::source returns it
    (#​199).
Changed
  • Breaking: from_multiple, from_multiple_with_options, from_slice_multiple, and
    from_slice_multiple_with_options now accept T: Deserialize<'de> so values can borrow from
    the input. They retain their names, single type parameter, and Vec<T> returns and are not
    deprecated. Ordinary calls, including from_multiple::<Config>(input) and generic callers
    with T: DeserializeOwned, continue to work. Function pointers or callbacks accepting arbitrary
    input lifetimes may need forwarding closures, such as |input| from_multiple::<String>(input).
  • Updated to granit-parser 2.0.0 and disabled its default features so comment support follows
    serde-saphyr's comments feature. Serialization-only builds remain independent of
    granit-parser, including when comment emission is enabled.
  • Non-finite floats remain rejected by default in deserialize_any, including overflowing
    literals such as 1e999. Opt into PassThrough to preserve them in float-capable visitors,
    untagged enums, and flattened float fields, or AsString to receive canonical strings.
    With PassThrough, serde_json::Value converts them to Null without an error.
    Direct f32/f64 deserialization is unchanged.
  • Breaking: Error::AliasError has a new mandatory error: Box<Error> field.
    Manual constructors must supply it, and patterns listing every field must add error or ...
    The variant name is unchanged. Rendering and source() use the original error; the
    deserializer still populates msg with an error.to_string() snapshot for existing handlers.
Deprecated
  • Deprecated Options::reject_non_finite_typeless_float in favor of non_finite_float_policy.
    When the new field is unconfigured, the boolean retains its original behavior: true
    (the default) rejects and false converts to strings. Use Reject or AsString, respectively,
    when migrating. Explicit policies override the boolean. Serialized options that omit both
    fields retain the 1.3.0 behavior of converting non-finite floats to strings;
    Options::default() continues to reject them.
  • Deprecated the msg field of Error::AliasError in favor of its structured error field.
    Existing Error::AliasError { msg, .. } patterns still work with a deprecation warning.
Fixed
  • Recognize only the standard plain null spellings: empty, ~, null, Null, and NULL.
    Other capitalization such as NulL remains a string instead of being rejected, converted
    to an empty value, or skipped as a document (#​234).
  • Buffered LastWins values and inline merges no longer produce alias errors when no
    alias was used. Replay preserves per-node origins, including genuine nested aliases,
    ordinary value locations, and merge use-sites for Spanned<T>.
  • strict_booleans: true now recognizes only the six YAML 1.2 Core boolean spellings.
    Other capitalization such as tRuE remains a string during inference, is accepted
    as unquoted text with no_schema, and is rejected for boolean targets.
  • Plain alias diagnostics explicitly label the use location with (used at line X, column Y).
    The new Localizer::alias_used_at hook controls this suffix independently of failure and
    definition locations. Custom localizers that previously used attach_location to format
    or suppress alias-use coordinates should override alias_used_at as well.
  • Miette diagnostics now localize alias labels, validation messages and summaries, and
    include context. Validation messages honor external-message overrides, and multi-document
    summaries honor custom message formatters. English defaults are unchanged.
    Custom Localizer implementations migrating from 1.x must also override
    anchor_defined_here to translate the alias anchor-definition label.
  • Validation snippet headers now show the actual source name instead of (defined) or
    (defined here), including errors in included YAML files.
  • Serde invalid-length failures now return Error::SerdeInvalidLength with separate
    len, expected, and location fields, allowing custom formatters to inspect them.
    Default diagnostic wording is preserved (#​205, item 6).
  • Root validation paths honor Localizer::root_path_label in plain, snippet, and
    miette diagnostics (#​205, item 5c).
  • Plain validation diagnostics separate issues with real newlines while escaping control
    characters inside each issue. Built-in formatters use the new optional
    MessageFormatter::format_validation_issue_lines hook; existing custom whole-message
    overrides retain their behavior (#​205, item 5a).
  • Nested containers reuse the alias error wrapper for the same use site, preserving the
    outer anchor location while exposing the original error directly through error, source(),
    and the legacy msg field (#​205, item 1).
  • Alias diagnostics preserve the precise location of a failing value inside an anchored mapping,
    including fields outside the anchor's snippet window. Plain messages, snippets, and miette
    reports include the distinct failing location; equal locations are not repeated.
  • Alias error rendering passes the original error to the active MessageFormatter, including
    formatters that delegate other variants to the built-in formatter. Plain messages report
    the alias definition and use locations once through the active Localizer; snippet and
    miette diagnostics use location labels without embedding plain-text location suffixes.
    Custom location formatting and suppression now apply throughout aliased values
    (#​199).
  • std::error::Error::source exposes the inner error for both Error::AliasError and
    Error::WithSnippet, preserving the source chain through the default snippet wrapper.
  • Made huge_documents and serde_derived_types enable deserialize, fixing isolated feature
    builds with --no-default-features, including autopkgtests of Debian team (as observed).
Documentation
  • Documented the serde_yaml migration caveat for null values in String fields,
    including when to use Option<String>, quoted strings, or !!str
    (#​229).

v1.3.0

Compare Source

Fixed
  • Integer mapping keys now compare by their parsed numeric value for duplicate detection and merge
    resolution, including inside composite keys (0xB and 11 compare equal). Deserializing to strings
    preserves the original spelling; FirstWins and LastWins retain the selected key's spelling
    and associated value.
  • Composite keys containing null-like strings now preserve both the key and its associated value;
    for example, {{"null": 1}: 2} now round-trips correctly.
  • Null mapping keys now remain distinct from null-like string keys during duplicate detection
    and merge resolution, including inside composite keys.
  • Null detection now respects string tags and scalar styles, preserving null-like strings such as
    !!str null, including when deserializing to Option<String>.
  • Explicit numeric tags (!!int and !!float) now deserialize correctly through deserialize_any,
    including quoted and block scalars.
  • Floating-point deserialization now rejects incompatible core tags; for example,
    from_str::<f64>("!!str 1.5") now returns an error.
  • Serialization now escapes U+FFFE and U+FFFF as \uFFFE and \uFFFF.
  • Serialization now preserves newline-only strings in literal block scalars, including
    LitStr and LitString, by using keep chomping and retaining every empty line.
  • Updated the granit-parser revision to preserve document boundaries after zero-indented root
    literal and folded block scalars, including empty strings.
  • Preserve string scalars across YAML 1.1 readers (PR #​90, thanks @​NiklasRosenstein)
  • The version increased to 1.3 because it uses granit-parser 1.3, and that is because granit-parser
    added two methods to Input for performance improvements. As serde-saphyr re-exports it,
    the version number must be increased to 1.3 as well, even if no new features are added to
    this crate itself.

v1.2.0

Compare Source

Changed
  • Folded property-interpolation depth and work limits into Budget; property resource-limit
    failures are now reported through Error::Budget and BudgetBreach.
  • Added the opt-in Options::reject_unsupported_tags strict mode. It rejects explicitly tagged
    scalar, sequence, and mapping nodes when their tag is unknown to serde-saphyr; the default remains
    permissive for compatibility with custom tagged enums. YAML 1.1 !!merge and !!value are
    accepted in this mode only as the exact scalar mapping keys << and =, respectively, while
    robotics-only !degrees and !radians require both the robotics crate feature and
    angle_conversions, and !include requires both the include crate feature and a configured
    resolver.
  • Enforced the scalar, sequence, or mapping node kinds required by recognized tags even when
    reject_unsupported_tags is disabled.
  • Hardened serializer indentation handling: indent_step is now limited to 1..=64, all
    serializer entry points validate it, and indentation arithmetic returns an error instead of
    overflowing. We do not consider this breaking because values outside this range does not look sane.
  • Validated custom anchor-generator names before emission. Names must be 1–256 bytes and cannot
    contain whitespace, control characters, or YAML flow punctuation; unsupported names now return
    a serialization error.
Fixes
  • Avoided unnecessary quotes around string keys and values containing an inline #, such as
    a#b, while retaining quotes for leading or whitespace-separated hashes. Borrowed from
    commit 1119a54
    under the terms of the Apache/MIT licenses. When property interpolation is configured,
    newly plain values such as ${NAME}#fragment can interpolate; use quote_all to preserve
    literal values.
  • Recognized explicit YAML 1.1 !!merge keys, including verbatim tags and %TAG-expanded
    handles, everywhere implicit << merge keys are supported.
  • Recognized the YAML 1.1 !!value tag while intentionally treating it as a no-op annotation.
  • Accepted valid zero-indented root folded block scalars, including #-prefixed content lines.
  • Fixed externally tagged typetag trait-object deserialization by consuming the closing mapping
    event when a Serde map visitor returns after its final key/value pair, preventing a false
    "multiple YAML documents" error.
  • Rejected non-UTF-8 canonical include and root-file paths before resolver policy checks and source
    identity handling, preventing lossy path collisions and policy bypasses on Unix.
  • Reported alias-use locations as primary for unsupported-tag and budget failures during replay,
    while retaining the anchor-definition locations as secondary context.
Testing
  • Reviewed yaml test suite, made sure all 350 active IDs and all 402 active cases are represented and documented
    we use YAML Test Suite v2022-01-17.
  • property test with 1,024 generated cases to check the round trip.
  • added tests for typetag.

v1.1.0

Compare Source

Added
  • Added granit-parser resource limits to Budget (#​172):

    • max_buffered_comment_events (default: 32)
    • simple_key_max_lookahead (default: 1,024 characters)
    • flow_nesting_limit (default: 255)

    The limits are applied to parsers created for strings, readers, standalone budget checks, and
    included YAML sources. When the serde_derived_types feature is enabled, deserializing an older
    Budget representation that omits these fields uses the documented defaults.

Fixes
  • Fixed enums tags for struct variants (#​177).
  • Improved error message wording (#​178).

v1.0.1: maintenance release

Compare Source

  • Fix #​170 regression on local type tags
  • By fixing granit-parser (use its release 1.0.1), explicitly fix #​169 (large scalar deserialization performance regression)

This release is fully API compatible with 1.0.0 and must be a drop-in replacement.

v1.0.0: - first real release

Compare Source

From this release onward, we are adopting the 1.x.x semantic versioning (SemVer) scheme. This means that API changes will be clearly reflected in the version number: the major version indicates breaking changes, the minor version indicates backward-compatible additions, and the patch version indicates backward-compatible fixes. The current compatibility status is indicated by the accompanying badge.

This release adds some #[track_caller] and #[must_use] annotations where looks reasonable. There are not many other changes that is exactly the point: the crate seems serving community well enough.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [serde-saphyr](https://github.com/bourumir-wyngs/serde-saphyr) | dependencies | major | `0.0.29` → `2.0.0` | --- ### Release Notes <details> <summary>bourumir-wyngs/serde-saphyr (serde-saphyr)</summary> ### [`v2.2.0`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#220) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/2.1.1...2.2.0) ##### Added - Added opt-in `Options::null_as_string` (default: `false`) to preserve plain `null`, `Null`, `NULL`, `~`, and empty scalars as text for string targets in both mapping keys and values, including `String`, `&str`, and `Cow<str>` ([#&#8203;267](https://github.com/bourumir-wyngs/serde-saphyr/issues/267)). Explicit `!!null` tags remain rejected for strings; `Option<T>`, untyped null inference, mapping-key comparison, and `no_schema` quoting requirements keep their existing behavior. - Added `Options::bom_inside_document_as_content` (default `false`) to preserve a BOM at the start of a token inside a document as plain scalar content, including in included YAML. A BOM in a document prefix is still skipped. ##### Fixed - Preserve uppercase radix prefixes (`0X`, `0O`, `0B`, including signed forms) as strings during implicit type inference, including untagged enums and flattened fields ([#&#8203;266](https://github.com/bourumir-wyngs/serde-saphyr/issues/266)). Direct typed integer parsing, explicit `!!int` tags, and mapping-key comparison retain their existing behavior. - Infer plain signed not-a-number spellings (`+.nan`, `-.NaN`, `-.NAN`) as strings during implicit type inference, since the YAML 1.2 Core schema allows a sign on `.inf` only ([#&#8203;271](https://github.com/bourumir-wyngs/serde-saphyr/issues/271); [#&#8203;272](https://github.com/bourumir-wyngs/serde-saphyr/pull/272), [#&#8203;273](https://github.com/bourumir-wyngs/serde-saphyr/pull/273)). This applies under every `NonFiniteFloatPolicy`, including untagged enums and flattened fields. Also accept these spellings without quotes when `no_schema: true` for string values and mapping keys, including `String`, `&str`, and `Cow<str>`. Direct untagged float targets continue to accept them as NaN. Explicit `!!float` scalars now preserve the supplied NaN sign when deserialized as floats. ##### Changed - Updated to granit-parser 2.2.0. Under-indented quoted scalar continuations in block context and tabs before quoted continuations are now accepted by default; `strict_indentation: true` continues to reject them. ### [`v2.1.1`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#211) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/2.1.0...2.1.1) ##### Fixed - Fixed 2.1.0 regression empty documents producing errors ([#&#8203;265](https://github.com/bourumir-wyngs/serde-saphyr/issues/265)). Empty document is a valid YAML document. ##### Performance improvements - Significantly reduced allocations when deserializing ([#&#8203;262](https://github.com/bourumir-wyngs/serde-saphyr/issues/262)) ### [`v2.1.0`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#210) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/2.0.0...2.1.0) ##### Added - Added `PropertySyntax::DockerComposeWithNulls`: Compose interpolation where a value that is solely a reference to an unset property, or whose expansion is `null`/`~`, becomes YAML null. Explicitly empty properties and empty defaults stay empty strings, and `DockerCompose` itself is unchanged. - Added opt-in `Options::reject_tagged_field_names` to catch misplaced tags on struct field names, with `Error::TaggedStructFieldName` diagnostics. Struct field names can only be strings, `!!str` is still accepted. As other tags can only be ignored, tag on a structure field name is almost for sure placed wrongly. This setting will be default in next major release. - Added `Options::leading_zero_numbers_as_strings` and `Options::underscored_numbers_as_strings` to preserve numeric spellings such as `0755` and `1_000` as strings in untyped values, including untagged enums and flattened fields ([#&#8203;225](https://github.com/bourumir-wyngs/serde-saphyr/issues/225)). Both default to `false`; direct typed parsing, explicit numeric tags, and mapping-key comparison keep their existing behavior. - Added `Error::render_to` to append diagnostics to any `std::fmt::Write` using `RenderOptions`, without collecting the complete output in an intermediate string ([#&#8203;221](https://github.com/bourumir-wyngs/serde-saphyr/issues/221)). - Added `DuplicateKeyPolicy::PassThrough` to delegate repeated explicit mapping entries to Serde visitors, matching `serde_yaml`'s handling for structs, standard maps, and custom multimap visitors ([#&#8203;226](https://github.com/bourumir-wyngs/serde-saphyr/issues/226)). The default remains `Error`; merge expansion retains its precedence rules. See the README migration note for the scope of this option. ##### Deprecated - Deprecated `SerializerOptions::empty_as_braces`. Setting it to `false` emits YAML null for empty block collections without tags or anchors. These values do not round-trip into collection types. Omit the setting to keep the default `true` and emit `[]` or `{}`. Existing serialization behavior remains supported for compatibility. ##### Fixed - Preserve application-tagged null-like documents in multi-document APIs, including the `garde` and `validator` integrations. A document such as `!Maybe null` now reaches enum dispatch instead of being skipped. This also affects default options: an `Option<String>` target receives a `None` item for `!Foo null`, while a `String` target reports `NullIntoString`. Untagged null documents and explicit `!!null` are still skipped. - Resolve tagged enum payloads according to their target type under `no_schema`: `!Number 42` can deserialize into a numeric payload, while a string payload still requires quoting, as in `!Text "42"`. This applies independently of property interpolation. - Keep validated and ordinary multi-document APIs consistent for interpolated nulls and interpolation work budgets. Reader iterators stop after an interpolation-budget breach, including breaches reported through an alias. - Emit empty lines in literal and folded block scalars without indentation, avoiding trailing whitespace while preserving whitespace in the string content ([#&#8203;249](https://github.com/bourumir-wyngs/serde-saphyr/issues/249)). - Expose the original `std::io::Error` from deserialization failures through `std::error::Error::source()`. The outer message is `IO error`, so error chains include the underlying cause only once. Standalone Miette, Figment, and Figment2 diagnostics retain the cause in their messages. Custom Miette formatters retain control over the complete message through `MessageFormatter::format_standalone_message`. - Avoid duplicate messages from `Error::WithSnippet` when following `std::error::Error::source()` by forwarding the wrapped error's source. Use `without_snippet()` to inspect the wrapped error. Alias errors retain their complete source chain, including snippet wrappers, for compatibility. - Validate recognized scalar tags consistently for numeric, boolean, character, and enum targets, including externally tagged enum mapping keys ([#&#8203;235](https://github.com/bourumir-wyngs/serde-saphyr/issues/235)). Incompatible tags and tagged null-like payloads no longer bypass validation. - Apply enabled robotics conversions to untyped reads, skipped fields, and flattened values. The local `!time` duration tag is distinct from standard YAML `!!timestamp`; robotics tags require the feature and `angle_conversions: true`. - Reject YAML null when deserializing sequences, mappings, and mapping-based structs instead of silently constructing empty values ([#&#8203;233](https://github.com/bourumir-wyngs/serde-saphyr/issues/233)). Blank values and the plain spellings `~`, `null`, `Null`, and `NULL` are handled consistently. Write `[]` for an empty sequence or `{}` for an empty mapping. `Option<T>` null handling and defaults for absent fields are unchanged; see the README migration notes. - Tags selecting unit enum variants now reject non-null payloads instead of silently discarding them ([#&#8203;236](https://github.com/bourumir-wyngs/serde-saphyr/issues/236)). Use a bare variant name, a tag with empty content, or a tag followed by `~` or `null`; quoted strings and collections are rejected. - Recognize only the standard plain null spellings: empty, `~`, `null`, `Null`, and `NULL`. Other capitalization such as `NulL` remains a string instead of being rejected, converted to an empty value, or skipped as a document ([#&#8203;234](https://github.com/bourumir-wyngs/serde-saphyr/issues/234)). - `strict_booleans: true` now recognizes only the six YAML 1.2 Core boolean spellings. Other capitalization such as `tRuE` remains a string during inference, is accepted as unquoted text with `no_schema`, and is rejected for boolean targets. - Recognize only the YAML 1.2 Core spellings of `.inf` and `.nan` during inference ([#&#8203;254](https://github.com/bourumir-wyngs/serde-saphyr/issues/254)). ### [`v2.0.0`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#200) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/1.3.0...2.0.0) ##### YAML changes - Composite mapping keys are not compared regardless of entry order (thanks [@&#8203;yuxi-liu-wired](https://github.com/yuxi-liu-wired)) . - Commented<T> now writes its output replacing characters not allowed in comments (non printable) by spaces. ##### Added - Added public `path_map::PathKind`, `PathKey::segments()`, and `PathMap::locations_for()` for inspecting validation paths and resolving their YAML use/definition locations, including best-effort spelling matches and recorded ancestor/root fallback. - Added `RenderOptions::line_offset` and `RenderOptions::source_name` for displaying embedded YAML diagnostics at their containing document's line numbers and naming the root source in snippet headers, including the new `miette::to_miette_report_with_options` entry point. Included files retain their own names and coordinates, and stored error locations and spans are unchanged. - Added `PropertySyntax::DockerCompose` for Compose-compatible property interpolation. - Added the default-enabled `comments` feature, forwarding to granit-parser's matching feature. Builds with `default-features = false` must enable it to use `Commented<T>`, `CommentPosition`, comment options, or comment budget fields and reports. Without it, YAML comments are still accepted and validated, but their text is not retained. - Added `Options::non_finite_float_policy` with `NonFiniteFloatPolicy::{PassThrough, Reject, AsString}` to configure non-finite floats delivered through `deserialize_any`. Explicit policies override the legacy boolean; leaving the field unconfigured preserves its behavior. - Added the `borrowed_context` example showing recursive `Serialize` adapters that borrow an existing value tree and per-call formatting context, composing with `Tagged<T>` and style wrappers without building a second container tree or using thread-local state. - Added `SerializerOptions::no_lang_directive` (default `false`) to suppress the `%YAML 1.2` directive and its leading `---` marker independently of `yaml_12`'s quoting. - Added `from_str_multiple`, `from_bytes_multiple`, and their `_with_options` variants to deserialize multiple YAML documents into any `C: Default + Extend<T>`, including vectors, queues, sets, and custom accumulators. Values can borrow from the input string or UTF-8 byte slice. Explicit type arguments specify both the document and collection types, for example `from_str_multiple::<String, Vec<_>>(input)`. - Added an `error: Box<Error>` field to `Error::AliasError`, which keeps the original error when an aliased value fails to deserialize. A custom `MessageFormatter` or `Localizer` now applies to that error, and `std::error::Error::source` returns it ([#&#8203;199](https://github.com/bourumir-wyngs/serde-saphyr/issues/199)). ##### Changed - **Breaking:** `from_multiple`, `from_multiple_with_options`, `from_slice_multiple`, and `from_slice_multiple_with_options` now accept `T: Deserialize<'de>` so values can borrow from the input. They retain their names, single type parameter, and `Vec<T>` returns and are not deprecated. Ordinary calls, including `from_multiple::<Config>(input)` and generic callers with `T: DeserializeOwned`, continue to work. Function pointers or callbacks accepting arbitrary input lifetimes may need forwarding closures, such as `|input| from_multiple::<String>(input)`. - Updated to granit-parser 2.0.0 and disabled its default features so comment support follows serde-saphyr's `comments` feature. Serialization-only builds remain independent of granit-parser, including when comment emission is enabled. - Non-finite floats remain rejected by default in `deserialize_any`, including overflowing literals such as `1e999`. Opt into `PassThrough` to preserve them in float-capable visitors, untagged enums, and flattened float fields, or `AsString` to receive canonical strings. With `PassThrough`, `serde_json::Value` converts them to `Null` without an error. Direct `f32`/`f64` deserialization is unchanged. - **Breaking:** `Error::AliasError` has a new mandatory `error: Box<Error>` field. Manual constructors must supply it, and patterns listing every field must add `error` or `..`. The variant name is unchanged. Rendering and `source()` use the original error; the deserializer still populates `msg` with an `error.to_string()` snapshot for existing handlers. ##### Deprecated - Deprecated `Options::reject_non_finite_typeless_float` in favor of `non_finite_float_policy`. When the new field is unconfigured, the boolean retains its original behavior: `true` (the default) rejects and `false` converts to strings. Use `Reject` or `AsString`, respectively, when migrating. Explicit policies override the boolean. Serialized options that omit both fields retain the 1.3.0 behavior of converting non-finite floats to strings; `Options::default()` continues to reject them. - Deprecated the `msg` field of `Error::AliasError` in favor of its structured `error` field. Existing `Error::AliasError { msg, .. }` patterns still work with a deprecation warning. ##### Fixed - Recognize only the standard plain null spellings: empty, `~`, `null`, `Null`, and `NULL`. Other capitalization such as `NulL` remains a string instead of being rejected, converted to an empty value, or skipped as a document ([#&#8203;234](https://github.com/bourumir-wyngs/serde-saphyr/issues/234)). - Buffered `LastWins` values and inline merges no longer produce alias errors when no alias was used. Replay preserves per-node origins, including genuine nested aliases, ordinary value locations, and merge use-sites for `Spanned<T>`. - `strict_booleans: true` now recognizes only the six YAML 1.2 Core boolean spellings. Other capitalization such as `tRuE` remains a string during inference, is accepted as unquoted text with `no_schema`, and is rejected for boolean targets. - Plain alias diagnostics explicitly label the use location with `(used at line X, column Y)`. The new `Localizer::alias_used_at` hook controls this suffix independently of failure and definition locations. Custom localizers that previously used `attach_location` to format or suppress alias-use coordinates should override `alias_used_at` as well. - Miette diagnostics now localize alias labels, validation messages and summaries, and include context. Validation messages honor external-message overrides, and multi-document summaries honor custom message formatters. English defaults are unchanged. Custom `Localizer` implementations migrating from 1.x must also override `anchor_defined_here` to translate the alias anchor-definition label. - Validation snippet headers now show the actual source name instead of `(defined)` or `(defined here)`, including errors in included YAML files. - Serde invalid-length failures now return `Error::SerdeInvalidLength` with separate `len`, `expected`, and `location` fields, allowing custom formatters to inspect them. Default diagnostic wording is preserved ([#&#8203;205, item 6](https://github.com/bourumir-wyngs/serde-saphyr/issues/205)). - Root validation paths honor `Localizer::root_path_label` in plain, snippet, and `miette` diagnostics ([#&#8203;205, item 5c](https://github.com/bourumir-wyngs/serde-saphyr/issues/205)). - Plain validation diagnostics separate issues with real newlines while escaping control characters inside each issue. Built-in formatters use the new optional `MessageFormatter::format_validation_issue_lines` hook; existing custom whole-message overrides retain their behavior ([#&#8203;205, item 5a](https://github.com/bourumir-wyngs/serde-saphyr/issues/205)). - Nested containers reuse the alias error wrapper for the same use site, preserving the outer anchor location while exposing the original error directly through `error`, `source()`, and the legacy `msg` field ([#&#8203;205, item 1](https://github.com/bourumir-wyngs/serde-saphyr/issues/205)). - Alias diagnostics preserve the precise location of a failing value inside an anchored mapping, including fields outside the anchor's snippet window. Plain messages, snippets, and `miette` reports include the distinct failing location; equal locations are not repeated. - Alias error rendering passes the original error to the active `MessageFormatter`, including formatters that delegate other variants to the built-in formatter. Plain messages report the alias definition and use locations once through the active `Localizer`; snippet and `miette` diagnostics use location labels without embedding plain-text location suffixes. Custom location formatting and suppression now apply throughout aliased values ([#&#8203;199](https://github.com/bourumir-wyngs/serde-saphyr/issues/199)). - `std::error::Error::source` exposes the inner error for both `Error::AliasError` and `Error::WithSnippet`, preserving the source chain through the default snippet wrapper. - Made `huge_documents` and `serde_derived_types` enable `deserialize`, fixing isolated feature builds with `--no-default-features`, including autopkgtests of Debian team (as [observed](https://dfsg-new-queue.debian.org/reviews/rust-serde-saphyr)). ##### Documentation - Documented the `serde_yaml` migration caveat for null values in `String` fields, including when to use `Option<String>`, quoted strings, or `!!str` ([#&#8203;229](https://github.com/bourumir-wyngs/serde-saphyr/issues/229)). ### [`v1.3.0`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#130-Maintenance-and-performance-release) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/1.2.0...1.3.0) ##### Fixed - Integer mapping keys now compare by their parsed numeric value for duplicate detection and merge resolution, including inside composite keys (`0xB` and `11` compare equal). Deserializing to strings preserves the original spelling; `FirstWins` and `LastWins` retain the selected key's spelling and associated value. - Composite keys containing null-like strings now preserve both the key and its associated value; for example, `{{"null": 1}: 2}` now round-trips correctly. - Null mapping keys now remain distinct from null-like string keys during duplicate detection and merge resolution, including inside composite keys. - Null detection now respects string tags and scalar styles, preserving null-like strings such as `!!str null`, including when deserializing to `Option<String>`. - Explicit numeric tags (`!!int` and `!!float`) now deserialize correctly through `deserialize_any`, including quoted and block scalars. - Floating-point deserialization now rejects incompatible core tags; for example, `from_str::<f64>("!!str 1.5")` now returns an error. - Serialization now escapes U+FFFE and U+FFFF as `\uFFFE` and `\uFFFF`. - Serialization now preserves newline-only strings in literal block scalars, including `LitStr` and `LitString`, by using keep chomping and retaining every empty line. - Updated the granit-parser revision to preserve document boundaries after zero-indented root literal and folded block scalars, including empty strings. - Preserve string scalars across YAML 1.1 readers (PR [#&#8203;90](https://github.com/bourumir-wyngs/serde-saphyr/issues/90), thanks [@&#8203;NiklasRosenstein](https://github.com/NiklasRosenstein)) - The version increased to 1.3 because it uses granit-parser 1.3, and that is because granit-parser added two methods to `Input` for performance improvements. As serde-saphyr re-exports it, the version number must be increased to 1.3 as well, even if no new features are added to this crate itself. ### [`v1.2.0`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#120-Maintenance-release) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/1.1.0...1.2.0) ##### Changed - Folded property-interpolation depth and work limits into `Budget`; property resource-limit failures are now reported through `Error::Budget` and `BudgetBreach`. - Added the opt-in `Options::reject_unsupported_tags` strict mode. It rejects explicitly tagged scalar, sequence, and mapping nodes when their tag is unknown to serde-saphyr; the default remains permissive for compatibility with custom tagged enums. YAML 1.1 `!!merge` and `!!value` are accepted in this mode only as the exact scalar mapping keys `<<` and `=`, respectively, while robotics-only `!degrees` and `!radians` require both the `robotics` crate feature and `angle_conversions`, and `!include` requires both the `include` crate feature and a configured resolver. - Enforced the scalar, sequence, or mapping node kinds required by recognized tags even when `reject_unsupported_tags` is disabled. - Hardened serializer indentation handling: `indent_step` is now limited to `1..=64`, all serializer entry points validate it, and indentation arithmetic returns an error instead of overflowing. We do not consider this breaking because values outside this range does not look sane. - Validated custom anchor-generator names before emission. Names must be 1–256 bytes and cannot contain whitespace, control characters, or YAML flow punctuation; unsupported names now return a serialization error. ##### Fixes - Avoided unnecessary quotes around string keys and values containing an inline `#`, such as `a#b`, while retaining quotes for leading or whitespace-separated hashes. Borrowed from [commit 1119a54](https://github.com/bourumir-wyngs/serde-saphyr/commit/1119a54cc184d2151d53089f6be1b311b0f57e5a) under the terms of the Apache/MIT licenses. When property interpolation is configured, newly plain values such as `${NAME}#fragment` can interpolate; use `quote_all` to preserve literal values. - Recognized explicit YAML 1.1 `!!merge` keys, including verbatim tags and `%TAG`-expanded handles, everywhere implicit `<<` merge keys are supported. - Recognized the YAML 1.1 `!!value` tag while intentionally treating it as a no-op annotation. - Accepted valid zero-indented root folded block scalars, including `#`-prefixed content lines. - Fixed externally tagged `typetag` trait-object deserialization by consuming the closing mapping event when a Serde map visitor returns after its final key/value pair, preventing a false "multiple YAML documents" error. - Rejected non-UTF-8 canonical include and root-file paths before resolver policy checks and source identity handling, preventing lossy path collisions and policy bypasses on Unix. - Reported alias-use locations as primary for unsupported-tag and budget failures during replay, while retaining the anchor-definition locations as secondary context. ##### Testing - Reviewed yaml test suite, made sure all 350 active IDs and all 402 active cases are represented and documented we use [YAML Test Suite v2022-01-17](https://github.com/yaml/yaml-test-suite/releases/tag/v2022-01-17). - property test with 1,024 generated cases to check the round trip. - added tests for [typetag](https://crates.io/crates/typetag). ### [`v1.1.0`](https://github.com/bourumir-wyngs/serde-saphyr/blob/HEAD/CHANGELOG.md#110-Maintenance-release) [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/1.0.1...1.1.0) ##### Added - Added granit-parser resource limits to `Budget` ([#&#8203;172](https://github.com/bourumir-wyngs/serde-saphyr/issues/172)): - `max_buffered_comment_events` (default: 32) - `simple_key_max_lookahead` (default: 1,024 characters) - `flow_nesting_limit` (default: 255) The limits are applied to parsers created for strings, readers, standalone budget checks, and included YAML sources. When the `serde_derived_types` feature is enabled, deserializing an older `Budget` representation that omits these fields uses the documented defaults. ##### Fixes - Fixed enums tags for struct variants ([#&#8203;177](https://github.com/bourumir-wyngs/serde-saphyr/issues/177)). - Improved error message wording ([#&#8203;178](https://github.com/bourumir-wyngs/serde-saphyr/issues/178)). ### [`v1.0.1`](https://github.com/bourumir-wyngs/serde-saphyr/releases/tag/1.0.1): maintenance release [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/1.0.0...1.0.1) - Fix [#&#8203;170](https://github.com/bourumir-wyngs/serde-saphyr/issues/170) regression on local type tags - By fixing granit-parser (use its release 1.0.1), explicitly fix [#&#8203;169](https://github.com/bourumir-wyngs/serde-saphyr/issues/169) (large scalar deserialization performance regression) This release is fully API compatible with 1.0.0 and must be a drop-in replacement. ### [`v1.0.0`](https://github.com/bourumir-wyngs/serde-saphyr/releases/tag/1.0.0): - first real release [Compare Source](https://github.com/bourumir-wyngs/serde-saphyr/compare/0.0.29...1.0.0) From this release onward, we are adopting the 1.x.x semantic versioning (SemVer) scheme. This means that API changes will be clearly reflected in the version number: the major version indicates breaking changes, the minor version indicates backward-compatible additions, and the patch version indicates backward-compatible fixes. The current compatibility status is indicated by the accompanying badge. This release adds some #\[track_caller] and #\[must_use] annotations where looks reasonable. There are not many other changes that is exactly the point: the crate seems serving community well enough. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMzYuMyIsInVwZGF0ZWRJblZlciI6IjQ0LjIzNi4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
renovate force-pushed renovate/serde-saphyr-2.x from 9f17d2a7c5 to a782f14946 2026-11-13 01:17:08 +00:00 Compare
renovate force-pushed renovate/serde-saphyr-2.x from a782f14946 to 810229ea93 2026-12-02 06:16:21 +00:00 Compare
kglitchy deleted branch renovate/serde-saphyr-2.x 2026-12-02 06:39:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kglitchy/simplefin-cli!15
No description provided.