Skip to content

Read, repair, check and merge JSON, and write YAML as ldo does - #3

Merged
craigthackerx merged 1 commit into
mainfrom
json-tools
Dec 4, 2026
Merged

craigthackerx merged 1 commit into
mainfrom
json-tools

Conversation

@craigthackerx

Copy link
Copy Markdown
Contributor

A Json module, the twin of the ldo CLI's ldo json commands, and a ConvertTo-LdoYaml that writes what ldo writes.

  • ConvertFrom-LdoJson, Repair-LdoJson, Test-LdoJson, Get-LdoJsonValue and Merge-LdoJson: JSON read as it was written (keys in order and case-sensitive, big numbers whole, strings never turned into dates), nearly JSON repaired when asked with each fix logged, and a deep merge or an RFC 7396 merge patch.
  • ConvertTo-LdoYaml keeps a multi-line string's ending (|-, |, |+), quotes what YAML 1.1 readers retype (12:30, 2026-09-24, 0x1F), and writes floats and dates the same way every time. New -Indent.
  • tests/shared holds the cases ldo-cli's tests run too (copied from its tests/fakes/shared), so the two agree exactly.

The version stays at 3.0.1 (already on the Gallery, so the publish skips); this goes out with the next release. See the CHANGELOG's Unreleased section.

Added
- A Json module, the twin of the ldo CLI's ldo json commands: ConvertFrom-LdoJson,
  Repair-LdoJson, Test-LdoJson, Get-LdoJsonValue and Merge-LdoJson. JSON is read as it was
  written (keys in order and case-sensitive, big numbers whole, strings never turned into
  dates), nearly JSON is repaired when asked with each fix logged, and documents merge
  deeply or as an RFC 7396 merge patch.
- tests/shared: the cases ldo's tests run too, so the two agree exactly.
- ConvertTo-LdoYaml -Indent.

Fixed
- ConvertTo-LdoYaml keeps a multi-line string's ending (|-, | or |+), where | added a line
  break to a string without one, and quotes what YAML 1.1 readers retype (12:30,
  2026-09-24, 0x1F, .inf, y, N). Control characters inside quotes are escaped.

Changed
- ConvertTo-LdoYaml writes floats as Python does (1.0, 1.0e-07, .nan) and dates in ISO 8601.
@craigthackerx
craigthackerx merged commit 058ffba into main Dec 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant