Repository navigation
Replace serde_yaml with serde_norway (#1937) - #2532
Merged
Archigos merged 3 commits intoDec 9, 2025
Merged
Conversation
- Allow offset parameter to accept String in addition to Number
- Enables variable injection like offset: '{{hours_offset}}'
- Parse string offset to i64, ignore if invalid (no error)
- Add test for string offset: offset_with_string_works
- Add test for invalid string offset: offset_with_invalid_string_is_ignored
- Update JSON schema to accept ['number', 'string'] for offset
- Maintains full backward compatibility with numeric offsets
Migrated from the deprecated serde_yaml (v0.8.17) to the actively maintained serde_norway (v0.9.42). serde_norway is a hard-fork of serde_yaml maintained by the original author David Tolnay along with Christina Sørensen. It provides full API compatibility while being actively maintained with regular updates. Changes: - Updated workspace dependency from serde_yaml to serde_norway - Replaced all serde_yaml imports with serde_norway across codebase - Added handling for serde_norway::Value::Tagged variant - All tests pass (202 tests) and cargo clippy reports no warnings Fixes espanso#1937
gcailly
marked this pull request as draft
October 12, 2025 16:52
Contributor
Author
|
I naively thought that solving #1937 would be simple. However, finding a replacement library is proving difficult. I really lack knowledge of the ecosystem. Some alternatives :
I picked the last one, but I'm getting a bit carried away and this PR is a suggestion. 🙂 |
gcailly
marked this pull request as ready for review
October 12, 2025 19:25
Collaborator
|
Thanks for the investigation! |
sboldt1978
pushed a commit
to sboldt1978/espanso
that referenced
this pull request
Feb 11, 2026
…ml-with-serde-norway Replace `serde_yaml` with `serde_norway` (espanso#1937)
YuriNachos
added a commit
to YuriNachos/espanso
that referenced
this pull request
Aug 8, 2026
Restore the pre-2.4.0 (serde_yaml) tolerance for unquoted flow-collection values that start with a YAML flow indicator (`:`, `>`, `|`), e.g. `triggers: [:->,:>-]`, which PR espanso#2532 (serde_yaml -> serde_norway) broke. serde_norway is libyaml-based and rejects such scalars with "did not find expected node content ... while parsing a flow node". Add a pure `lenient_flow_quote` helper applied only on retry-on-failure: the strict parse is tried first, so every config that parses today is returned byte-for-byte untouched. The fix covers both YAMLMatchGroup and YAMLConfig parse entry points via a shared `parse_lenient<T>` wrapper in `util`. `|`/`>` block-scalar bodies (e.g. a multi-line `replace: |` whose literal text contains `[ ... ]`) are detected and copied verbatim, so the transform never re-quotes inside them. Fixes espanso#2748 Co-Authored-By: Claude <[email protected]>
AucaCoyan
added a commit
that referenced
this pull request
Sep 1, 2026
…ons (#2761) * fix(config): parse unquoted special-char values in YAML flow collections Restore the pre-2.4.0 (serde_yaml) tolerance for unquoted flow-collection values that start with a YAML flow indicator (`:`, `>`, `|`), e.g. `triggers: [:->,:>-]`, which PR #2532 (serde_yaml -> serde_norway) broke. serde_norway is libyaml-based and rejects such scalars with "did not find expected node content ... while parsing a flow node". Add a pure `lenient_flow_quote` helper applied only on retry-on-failure: the strict parse is tried first, so every config that parses today is returned byte-for-byte untouched. The fix covers both YAMLMatchGroup and YAMLConfig parse entry points via a shared `parse_lenient<T>` wrapper in `util`. `|`/`>` block-scalar bodies (e.g. a multi-line `replace: |` whose literal text contains `[ ... ]`) are detected and copied verbatim, so the transform never re-quotes inside them. Fixes #2748 Co-Authored-By: Claude <[email protected]> * fix clippy lints --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Auca Maillot <[email protected]>
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 migrates from the deprecated
serde_yamlto the actively maintainedserde_norway.serde_yaml = "0.8.17"→serde_norway = "0.9.42".serde_yamlimports withserde_norwayacross the codebase (15 files).serde_norway::Value::Taggedvariant (new feature for YAML custom tags).Fixes #1937