Context
YAML 1.2.2 requires verbatim and expanded tags to denote either local tags beginning with ! or global URI tags. Tags that cannot denote a type are invalid and should not be carried forward as unknown application data.
Official YAML 1.2.2 references:
Current State
The module validates tag character syntax and escape syntax and safely treats unknown tags as non-activating metadata. Some tags that are syntactically character-valid but not valid local/global tags can still be accepted as unknown tags.
Objective
Reject invalid tag text consistently across parsing, validation, formatting, and merging surfaces while preserving the safe behavior for valid unknown tags.
PowerShell Design Considerations
- Invalid tags should produce stable, location-rich terminating errors for conversion commands and
$false for Test-Yaml.
- Valid unknown tags must remain safe and must not load .NET types or invoke PowerShell commands.
- The validation should be a default conformance correction, not an opt-in parameter set.
- Error records should be useful in pipeline automation, including line and column context.
Tasks
Benefits
- Prevents invalid YAML representations from being normalized or projected.
- Separates tag validity from native type availability.
- Keeps the module safe while improving YAML 1.2.2 conformance.
Acceptance Criteria
Related
Context
YAML 1.2.2 requires verbatim and expanded tags to denote either local tags beginning with
!or global URI tags. Tags that cannot denote a type are invalid and should not be carried forward as unknown application data.Official YAML 1.2.2 references:
docs/yaml-spec-1.2.2/07-chapter-structural-productions/09-node-properties/01-node-tags/index.mdspec/Tag-Validation.mdCurrent State
The module validates tag character syntax and escape syntax and safely treats unknown tags as non-activating metadata. Some tags that are syntactically character-valid but not valid local/global tags can still be accepted as unknown tags.
Objective
Reject invalid tag text consistently across parsing, validation, formatting, and merging surfaces while preserving the safe behavior for valid unknown tags.
PowerShell Design Considerations
$falseforTest-Yaml.Tasks
!, or neither local tags nor global URI tags.Benefits
Acceptance Criteria
!<!>,!<>,!<$:?>, and!<example>terminate withYamlInvalidTagon conversion/import surfaces.Test-Yamlreturns$falsefor invalid tag streams.Format-YamlandMerge-Yamlreject invalid tags rather than emitting them unchanged.Related
spec/Tag-Validation.md