# YAML Test Matrix

--- &test-QLJ7
  Title: Tag shorthand used in documents but only defined in the first
  Tags: [ directive, error, tag ]

YAML

%TAG !prefix! tag:example.com,2011:
--- !prefix!A
a: b
--- !prefix!B
c: d
--- !prefix!C
e: f

Expected Events

+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

Expected JSON



cpp-rapidyaml-event

 invalid_incorrect
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---
+MAP <tag:example.com,2011:B>
=VAL :c
=VAL :d
-MAP
-DOC
+DOC ---
+MAP <tag:example.com,2011:C>
=VAL :e
=VAL :f
-MAP
-DOC
-STR

cpp-yamlcpp-event

 invalid_incorrect
+STR
+DOC
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC
+MAP <tag:example.com,2011:B>
=VAL :c
=VAL :d
-MAP
-DOC
+DOC
+MAP <tag:example.com,2011:C>
=VAL :e
=VAL :f
-MAP
-DOC
-STR

hs-reference-yeast

 invalid_incorrect
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +DIR |
   1    0    0    0 =SYNX|%
   1    1    1    1 =META|TAG
   1    4    4    4 =WSPC|.
   1    5    5    5 +HAND|
   1    5    5    5 =SYNX|!
   1    6    6    6 =META|prefix
   1   12   12   12 =SYNX|!
   1   13   13   13 -HAND|
   1   13   13   13 =WSPC|.
   1   14   14   14 +TAG |
   1   14   14   14 =META|tag:example.com,2011:
   1   35   35   35 -TAG |
   1   35   35   35 -DIR |
   1   35   35   35 =EOL |\x0a
   2    0   36   36 =HEAD|---
   2    3   39   39 +NODE|
   2    3   39   39 =WSPC|.
   2    4   40   40 +PROP|
   2    4   40   40 +TAG |
   2    4   40   40 +HAND|
   2    4   40   40 =SYNX|!
   2    5   41   41 =META|prefix
   2   11   47   47 =SYNX|!
   2   12   48   48 -HAND|
   2   12   48   48 =META|A
   2   13   49   49 -TAG |
   2   13   49   49 -PROP|
   2   13   49   49 =EOL |\x0a
   3    0   50   50 +MAP |
   3    0   50   50 +PAIR|
   3    0   50   50 +NODE|
   3    0   50   50 +VAL |
   3    0   50   50 =TEXT|a
   3    1   51   51 -VAL |
   3    1   51   51 -NODE|
   3    1   51   51 =SYNX|:
   3    2   52   52 =WSPC|.
   3    3   53   53 +NODE|
   3    3   53   53 +VAL |
   3    3   53   53 =TEXT|b
   3    4   54   54 -VAL |
   3    4   54   54 -NODE|
   3    4   54   54 =EOL |\x0a
   4    0   55   55 -PAIR|
   4    0   55   55 -MAP |
   4    0   55   55 -NODE|
   4    0   55   55 -DOC |
   4    0   55   55 +DOC |
   4    0   55   55 =HEAD|---
   4    3   58   58 +NODE|
   4    3   58   58 =WSPC|.
   4    4   59   59 +PROP|
   4    4   59   59 +TAG |
   4    4   59   59 +HAND|
   4    4   59   59 =SYNX|!
   4    5   60   60 =META|prefix
   4   11   66   66 =SYNX|!
   4   12   67   67 -HAND|
   4   12   67   67 =META|B
   4   13   68   68 -TAG |
   4   13   68   68 -PROP|
   4   13   68   68 =EOL |\x0a
   5    0   69   69 +MAP |
   5    0   69   69 +PAIR|
   5    0   69   69 +NODE|
   5    0   69   69 +VAL |
   5    0   69   69 =TEXT|c
   5    1   70   70 -VAL |
   5    1   70   70 -NODE|
   5    1   70   70 =SYNX|:
   5    2   71   71 =WSPC|.
   5    3   72   72 +NODE|
   5    3   72   72 +VAL |
   5    3   72   72 =TEXT|d
   5    4   73   73 -VAL |
   5    4   73   73 -NODE|
   5    4   73   73 =EOL |\x0a
   6    0   74   74 -PAIR|
   6    0   74   74 -MAP |
   6    0   74   74 -NODE|
   6    0   74   74 -DOC |
   6    0   74   74 +DOC |
   6    0   74   74 =HEAD|---
   6    3   77   77 +NODE|
   6    3   77   77 =WSPC|.
   6    4   78   78 +PROP|
   6    4   78   78 +TAG |
   6    4   78   78 +HAND|
   6    4   78   78 =SYNX|!
   6    5   79   79 =META|prefix
   6   11   85   85 =SYNX|!
   6   12   86   86 -HAND|
   6   12   86   86 =META|C
   6   13   87   87 -TAG |
   6   13   87   87 -PROP|
   6   13   87   87 =EOL |\x0a
   7    0   88   88 +MAP |
   7    0   88   88 +PAIR|
   7    0   88   88 +NODE|
   7    0   88   88 +VAL |
   7    0   88   88 =TEXT|e
   7    1   89   89 -VAL |
   7    1   89   89 -NODE|
   7    1   89   89 =SYNX|:
   7    2   90   90 =WSPC|.
   7    3   91   91 +NODE|
   7    3   91   91 +VAL |
   7    3   91   91 =TEXT|f
   7    4   92   92 -VAL |
   7    4   92   92 -NODE|
   7    4   92   92 =EOL |\x0a
   8    0   93   93 -PAIR|
   8    0   93   93 -MAP |
   8    0   93   93 -NODE|
   8    0   93   93 -DOC |

perl-syck-json

 invalid_incorrect
{
   "%TAG !prefix! tag:example.com,2011" : null
}
{
   "a" : "b"
}
{
   "c" : "d"
}
{
   "e" : "f"
}

perl-syck-perl

 invalid_incorrect
{
  '%TAG !prefix! tag:example.com,2011' => undef
}
{
  'a' => 'b'
}
{
  'c' => 'd'
}
{
  'e' => 'f'
}

rust-yamlrust-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :a
=VAL :b
-MAP
-DOC
+DOC
+MAP
=VAL :c
=VAL :d
-MAP
-DOC
+DOC
+MAP
=VAL :e
=VAL :f
-MAP
-DOC
-STR

c-libfyaml-event

 invalid_correct
stdin:4:5: error: undefined tag prefix
--- !prefix!B
    ^~~~~~~~~
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

c-libfyaml-json

 invalid_correct
stdin:4:5: error: undefined tag prefix
--- !prefix!B
    ^~~~~~~~~
{
  "a": "b"
}

c-libyaml-event

 invalid_correct
Parse error: found undefined tag handle
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

dotnet-yamldotnet-event

 invalid_correct
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 4, Col: 5, Idx: 59) - (Line: 4, Col: 14, Idx: 68): While parsing a node, found undefined tag handle.
   at YamlDotNet.Core.Parser.ParseNode(Boolean isBlock, Boolean isIndentlessSequence)
   at YamlDotNet.Core.Parser.ParseDocumentContent()
   at YamlDotNet.Core.Parser.StateMachine()
   at YamlDotNet.Core.Parser.MoveNext()
   at YamlDotNet.RepresentationModel.LibYamlEventStream.WriteTo(TextWriter textWriter)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

dotnet-yamldotnet-json

 invalid_correct
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 2, Col: 5, Idx: 40) - (Line: 3, Col: 1, Idx: 50): Encountered an unresolved tag 'tag:example.com,2011:A'
   at YamlDotNet.Serialization.NodeTypeResolvers.PreventUnknownTagsNodeTypeResolver.YamlDotNet.Serialization.INodeTypeResolver.Resolve(NodeEvent nodeEvent, Type& currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.GetTypeFromEvent(NodeEvent nodeEvent, Type currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

go-yaml-json

 invalid_correct
yaml: line 3: found undefined tag handle
{"a":"b"}

hs-hsyaml-event

 invalid_correct
Parsing error near byte offset Pos {posByteOffset = 59, posCharOffset = 59, posLine = 4, posColumn = 4} (Parse failure near BeginHandle token)
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

hs-hsyaml-json

 invalid_correct
hsyaml-parser: user error (Parse failure near BeginHandle token)

js-jsyaml-json

 invalid_correct
/node/node_modules/js-yaml/lib/loader.js:187
  throw generateError(state, message);
  ^
YAMLException: unknown tag !<tag:example.com,2011:A> (4:1)

 1 | %TAG !prefix! tag:example.com,2011:
 2 | --- !prefix!A
 3 | a: b
 4 | --- !prefix!B
-----^
 5 | c: d
 6 | --- !prefix!C
    at generateError (/node/node_modules/js-yaml/lib/loader.js:183:10)
    at throwError (/node/node_modules/js-yaml/lib/loader.js:187:9)
    at composeNode (/node/node_modules/js-yaml/lib/loader.js:1521:7)
    at readDocument (/node/node_modules/js-yaml/lib/loader.js:1625:3)
    at loadDocuments (/node/node_modules/js-yaml/lib/loader.js:1688:5)
    at Object.loadAll (/node/node_modules/js-yaml/lib/loader.js:1701:19)
    at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32) {
  reason: 'unknown tag !<tag:example.com,2011:A>',
  mark: {
    name: null,
    buffer: '%TAG !prefix! tag:example.com,2011:\n' +
      '--- !prefix!A\n' +
      'a: b\n' +
      '--- !prefix!B\n' +
      'c: d\n' +
      '--- !prefix!C\n' +
      'e: f\n',
    position: 55,
    line: 3,
    column: 0,
    snippet: ' 1 | %TAG !prefix! tag:example.com,2011:\n' +
      ' 2 | --- !prefix!A\n' +
      ' 3 | a: b\n' +
      ' 4 | --- !prefix!B\n' +
      '-----^\n' +
      ' 5 | c: d\n' +
      ' 6 | --- !prefix!C'
  }
}

Node.js v20.13.1

js-yaml-event

 invalid_correct
Could not resolve tag: !prefix!B at line 4, column 5:

--- !prefix!B
    ^^^^^^^^^
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

js-yaml-json

 invalid_correct
/yaml/bin/js-yaml-json:9
    if (doc.errors.length !== 0) throw doc.errors[0]
                                 ^

YAMLParseError: Could not resolve tag: !prefix!B at line 4, column 5:

--- !prefix!B
    ^^^^^^^^^

    at Composer.onError (/node/node_modules/yaml/dist/compose/composer.js:69:34)
    at /node/node_modules/yaml/dist/compose/compose-collection.js:31:58
    at Directives.tagName (/node/node_modules/yaml/dist/doc/directives.js:136:9)
    at Object.composeCollection (/node/node_modules/yaml/dist/compose/compose-collection.js:31:26)
    at Object.composeNode (/node/node_modules/yaml/dist/compose/compose-node.js:31:38)
    at Object.composeDoc (/node/node_modules/yaml/dist/compose/compose-doc.js:34:23)
    at Composer.next (/node/node_modules/yaml/dist/compose/composer.js:149:40)
    at next (<anonymous>)
    at Composer.compose (/node/node_modules/yaml/dist/compose/composer.js:131:25)
    at compose.next (<anonymous>) {
  code: 'TAG_RESOLVE_FAILED',
  pos: [ 59, 68 ],
  linePos: [ { line: 4, col: 5 }, { line: 4, col: 14 } ]
}

Node.js v20.13.1

lua-lyaml-json

 invalid_correct
luajit: 4:1: found undefined tag handle
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:306: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:325: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:443: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:497: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x55ea87b6bed0

nim-nimyaml-event

 invalid_correct
/tmp/NimYAML-0.16.0/yaml/stream.nim(134) nimyaml_event
/tmp/NimYAML-0.16.0/yaml/stream.nim(106) next
Error: unhandled exception: unknown handle: "!prefix!" [YamlStreamError]
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

perl-pp-event

 invalid_correct
Found undefined tag handle '!prefix!' at /perl5/lib/perl5/YAML/PP/Parser.pm line 994, <STDIN> line 1.
 at /yaml/bin/perl-pp-event line 46.
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

perl-pp-json

 invalid_correct
Found undefined tag handle '!prefix!' at /perl5/lib/perl5/YAML/PP/Parser.pm line 994, <> line 1.
 at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.

perl-pp-perl

 invalid_correct
Found undefined tag handle '!prefix!' at /perl5/lib/perl5/YAML/PP/Parser.pm line 994, <> line 1.
 at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.

perl-pplibyaml-json

 invalid_correct
YAML::PP::LibYAML Error: The problem:

    found undefined tag handle

was found at , line: 4, column: 5
while parsing a node at line: 4, column: 5

perl-pplibyaml-perl

 invalid_correct
YAML::PP::LibYAML Error: The problem:

    found undefined tag handle

was found at , line: 4, column: 5
while parsing a node at line: 4, column: 5

perl-refparser-event

 invalid_correct
No %TAG entry for '' at /perl5/lib/perl5/YAML/Parser.pm line 5097, <> line 1.

perl-tiny-json

 invalid_correct
YAML::Tiny does not support a feature in line '!prefix!A' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 invalid_correct
YAML::Tiny does not support a feature in line '!prefix!A' at /yaml/bin/perl-tiny-perl line 15.

perl-xs-json

 invalid_correct
YAML::XS::Load Error: The problem:

    bad tag found for hash: 'tag:example.com,2011:A'

was found at document: 1

perl-xs-perl

 invalid_correct
YAML::XS::Load Error: The problem:

    bad tag found for hash: 'tag:example.com,2011:A'

was found at document: 1

perl-yaml-json

 invalid_correct
Use of uninitialized value in sprintf at /perl5/lib/perl5/YAML/Error.pm line 18, <> line 1.
YAML Error: Can't parse inline implicit value ''
   Code: YAML_PARSE_ERR_BAD_INLINE_IMPLICIT
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 607.

perl-yaml-perl

 invalid_correct
Use of uninitialized value in sprintf at /perl5/lib/perl5/YAML/Error.pm line 18, <> line 1.
YAML Error: Can't parse inline implicit value ''
   Code: YAML_PARSE_ERR_BAD_INLINE_IMPLICIT
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 607.

py-pyyaml-event

 invalid_correct
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-event", line 7, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/yaml/__init__.py", line 75, in parse
    while loader.check_event():
          ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 215, in parse_document_content
    return self.parse_block_node()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 265, in parse_block_node
    return self.parse_node(block=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 305, in parse_node
    raise ParserError("while parsing a node", start_mark,
yaml.parser.ParserError: while parsing a node
found undefined tag handle '!prefix!'
  in "<unicode string>", line 4, column 5:
    --- !prefix!B
        ^
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

py-pyyaml-json

 invalid_correct
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-json", line 19, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.12/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
          ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
                                   ^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 27, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 215, in parse_document_content
    return self.parse_block_node()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 265, in parse_block_node
    return self.parse_node(block=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 305, in parse_node
    raise ParserError("while parsing a node", start_mark,
yaml.parser.ParserError: while parsing a node
found undefined tag handle '!prefix!'
  in "<unicode string>", line 4, column 5:
    --- !prefix!B
        ^
{
  "a": "b"
}

py-pyyaml-py

 invalid_correct
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-py", line 36, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.12/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
          ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
                                   ^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 27, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 215, in parse_document_content
    return self.parse_block_node()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 265, in parse_block_node
    return self.parse_node(block=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 305, in parse_node
    raise ParserError("while parsing a node", start_mark,
yaml.parser.ParserError: while parsing a node
found undefined tag handle '!prefix!'
  in "<unicode string>", line 4, column 5:
    --- !prefix!B
        ^
GenericMapping(tag='tag:example.com,2011:A', content={'a': 'b'})

py-ruamel-event

 invalid_correct
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-event", line 9, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 371, in parse
    while parser.check_event():
          ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 286, in parse_document_content
    return self.parse_block_node()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 349, in parse_block_node
    return self.parse_node(block=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 407, in parse_node
    raise ParserError(
ruamel.yaml.parser.ParserError: while parsing a node
found undefined tag handle '!prefix!'
  in "<unicode string>", line 4, column 5:
    --- !prefix!B
        ^ (line: 4)
+STR
+DOC ---
+MAP <tag:example.com,2011:A>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---

py-ruamel-json

 invalid_correct
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-json", line 21, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 476, in load_all
    yield constructor.get_data()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 110, in get_data
    return self.construct_document(self.composer.get_node())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 63, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 106, in compose_node
    if self.parser.check_event(AliasEvent):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 286, in parse_document_content
    return self.parse_block_node()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 349, in parse_block_node
    return self.parse_node(block=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 407, in parse_node
    raise ParserError(
ruamel.yaml.parser.ParserError: while parsing a node
found undefined tag handle '!prefix!'
  in "<unicode string>", line 4, column 5:
    --- !prefix!B
        ^ (line: 4)
{
  "a": "b"
}

py-ruamel-py

 invalid_correct
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-py", line 38, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 476, in load_all
    yield constructor.get_data()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 110, in get_data
    return self.construct_document(self.composer.get_node())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 63, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 106, in compose_node
    if self.parser.check_event(AliasEvent):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 286, in parse_document_content
    return self.parse_block_node()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 349, in parse_block_node
    return self.parse_node(block=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 407, in parse_node
    raise ParserError(
ruamel.yaml.parser.ParserError: while parsing a node
found undefined tag handle '!prefix!'
  in "<unicode string>", line 4, column 5:
    --- !prefix!B
        ^ (line: 4)
GenericMapping(tag='tag:example.com,2011:A', content={'a': 'b'})

ruby-psych-json

 invalid_correct
/ruby/gems/psych/lib/psych.rb:458:in `parse': (<unknown>): found undefined tag handle while parsing a node at line 4 column 5 (Psych::SyntaxError)
	from /ruby/gems/psych/lib/psych.rb:458:in `parse_stream'
	from /ruby/gems/psych/lib/psych.rb:632:in `load_stream'
	from /yaml/bin/ruby-psych-json:6:in `<main>'