Repository navigation
Get values out of YAML, read as YAML 1.2 reads it - #4
Merged
Merged
Conversation
Get-LdoYamlValue, the twin of ldo yaml get, on a port of the ldo CLI's YAML reader: no yq or powershell-yaml needed. Values are typed by YAML 1.2's core schema, so yes, 12:30 and 2026-09-24 stay strings; anchors and << merges are filled in; and a custom tag, a tab in the indentation, a YAML bomb and nesting past 100 are refused with the line and column. The two readers agree through tests/shared/yaml-read.json, and yaml.json is renamed yaml-write.json, as in ldo-cli.
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.
Get-LdoYamlValue, the twin of the ldo CLI'sldo yaml get, on a PowerShell port of its YAML reader: no yq or powershell-yaml needed.yes,on,12:30and2026-09-24stay strings, and010is ten.<<merges are filled in. A key given twice is a warning, and the last is kept.!Ref,!reference), a tab in the indentation, a YAML bomb and nesting past 100 are refused, naming the line and column.Get-LdoJsonValue's, and a path it cannot read is refused before the YAML is read.The two readers agree through
tests/shared/yaml-read.json(110 cases, copied from ldo-cli).tests/shared/yaml.jsonis renamedyaml-write.json, as it is in ldo-cli.