Skip to content

build(cargo): Update Rust crate serde-saphyr to v2 - #47

Open
Crown0815 wants to merge 1 commit into
mainfrom
renovate/major-cargo-dependencies
Open

Crown0815 wants to merge 1 commit into
mainfrom
renovate/major-cargo-dependencies

Conversation

@Crown0815

Copy link
Copy Markdown
Owner

This PR contains the following updates:

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

Release Notes

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

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
  • 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>.
  • 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).

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 branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants