Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.0.0→2.0.0Release Notes
bourumir-wyngs/serde-saphyr (serde-saphyr)
v2.0.0Compare Source
YAML changes
Added
path_map::PathKind,PathKey::segments(), andPathMap::locations_for()for inspecting validation paths and resolving their YAML use/definition locations,
including best-effort spelling matches and recorded ancestor/root fallback.
RenderOptions::line_offsetandRenderOptions::source_namefor displayingembedded 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_optionsentry point. Included files retain their ownnames and coordinates, and stored error locations and spans are unchanged.
PropertySyntax::DockerComposefor Compose-compatible property interpolation.commentsfeature, forwarding to granit-parser's matchingfeature. Builds with
default-features = falsemust enable it to useCommented<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.
Options::non_finite_float_policywithNonFiniteFloatPolicy::{PassThrough, Reject, AsString}to configure non-finite floats delivered through
deserialize_any. Explicit policies overridethe legacy boolean; leaving the field unconfigured preserves its behavior.
borrowed_contextexample showing recursiveSerializeadapters that borrowan existing value tree and per-call formatting context, composing with
Tagged<T>andstyle wrappers without building a second container tree or using thread-local state.
SerializerOptions::no_lang_directive(defaultfalse) to suppress the%YAML 1.2directive and its leading---marker independently ofyaml_12's quoting.from_str_multiple,from_bytes_multiple, and their_with_optionsvariants todeserialize 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).error: Box<Error>field toError::AliasError, which keeps the original errorwhen an aliased value fails to deserialize. A custom
MessageFormatterorLocalizernow applies to that error, and
std::error::Error::sourcereturns it(#199).
Changed
from_multiple,from_multiple_with_options,from_slice_multiple, andfrom_slice_multiple_with_optionsnow acceptT: Deserialize<'de>so values can borrow fromthe input. They retain their names, single type parameter, and
Vec<T>returns and are notdeprecated. Ordinary calls, including
from_multiple::<Config>(input)and generic callerswith
T: DeserializeOwned, continue to work. Function pointers or callbacks accepting arbitraryinput lifetimes may need forwarding closures, such as
|input| from_multiple::<String>(input).serde-saphyr's
commentsfeature. Serialization-only builds remain independent ofgranit-parser, including when comment emission is enabled.
deserialize_any, including overflowingliterals such as
1e999. Opt intoPassThroughto preserve them in float-capable visitors,untagged enums, and flattened float fields, or
AsStringto receive canonical strings.With
PassThrough,serde_json::Valueconverts them toNullwithout an error.Direct
f32/f64deserialization is unchanged.Error::AliasErrorhas a new mandatoryerror: Box<Error>field.Manual constructors must supply it, and patterns listing every field must add
erroror...The variant name is unchanged. Rendering and
source()use the original error; thedeserializer still populates
msgwith anerror.to_string()snapshot for existing handlers.Deprecated
Options::reject_non_finite_typeless_floatin favor ofnon_finite_float_policy.When the new field is unconfigured, the boolean retains its original behavior:
true(the default) rejects and
falseconverts to strings. UseRejectorAsString, 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.msgfield ofError::AliasErrorin favor of its structurederrorfield.Existing
Error::AliasError { msg, .. }patterns still work with a deprecation warning.Fixed
LastWinsvalues and inline merges no longer produce alias errors when noalias was used. Replay preserves per-node origins, including genuine nested aliases,
ordinary value locations, and merge use-sites for
Spanned<T>.(used at line X, column Y).The new
Localizer::alias_used_athook controls this suffix independently of failure anddefinition locations. Custom localizers that previously used
attach_locationto formator suppress alias-use coordinates should override
alias_used_atas well.include context. Validation messages honor external-message overrides, and multi-document
summaries honor custom message formatters. English defaults are unchanged.
Custom
Localizerimplementations migrating from 1.x must also overrideanchor_defined_hereto translate the alias anchor-definition label.(defined)or(defined here), including errors in included YAML files.Error::SerdeInvalidLengthwith separatelen,expected, andlocationfields, allowing custom formatters to inspect them.Default diagnostic wording is preserved (#205, item 6).
Localizer::root_path_labelin plain, snippet, andmiettediagnostics (#205, item 5c).characters inside each issue. Built-in formatters use the new optional
MessageFormatter::format_validation_issue_lineshook; existing custom whole-messageoverrides retain their behavior (#205, item 5a).
outer anchor location while exposing the original error directly through
error,source(),and the legacy
msgfield (#205, item 1).including fields outside the anchor's snippet window. Plain messages, snippets, and
miettereports include the distinct failing location; equal locations are not repeated.
MessageFormatter, includingformatters that delegate other variants to the built-in formatter. Plain messages report
the alias definition and use locations once through the active
Localizer; snippet andmiettediagnostics use location labels without embedding plain-text location suffixes.Custom location formatting and suppression now apply throughout aliased values
(#199).
std::error::Error::sourceexposes the inner error for bothError::AliasErrorandError::WithSnippet, preserving the source chain through the default snippet wrapper.huge_documentsandserde_derived_typesenabledeserialize, fixing isolated featurebuilds with
--no-default-features, including autopkgtests of Debian team (as observed).Configuration
📅 Schedule: (UTC)
🚦 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.
This PR has been generated by Mend Renovate CLI.