Skip to content

Get values out of YAML, read as YAML 1.2 reads it - #4

Merged
craigthackerx merged 1 commit into
mainfrom
yaml-get-value
Dec 4, 2026
Merged

craigthackerx merged 1 commit into
mainfrom
yaml-get-value

Conversation

@craigthackerx

Copy link
Copy Markdown
Contributor

Get-LdoYamlValue, the twin of the ldo CLI's ldo yaml get, on a PowerShell port of its YAML reader: no yq or powershell-yaml needed.

  • Values are typed by YAML 1.2's core schema, as yq and Terraform type them: yes, on, 12:30 and 2026-09-24 stay strings, and 010 is ten.
  • Anchors, aliases and << merges are filled in. A key given twice is a warning, and the last is kept.
  • A custom tag (!Ref, !reference), a tab in the indentation, a YAML bomb and nesting past 100 are refused, naming the line and column.
  • Paths are 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.json is renamed yaml-write.json, as it is in ldo-cli.

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.
@craigthackerx
craigthackerx merged commit 1ae4c79 into main Dec 4, 2026
1 check passed
@craigthackerx
craigthackerx deleted the yaml-get-value branch December 4, 2026 22:59
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