| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
- name: Two simple mappings |
| 5 |
text: | |
| 6 |
doc1: value1 |
| 7 |
--- |
| 8 |
doc2: value2 |
| 9 |
node: | |
| 10 |
- mapping: |
| 11 |
- plain: doc1 |
| 12 |
- plain: value1 |
| 13 |
- mapping: |
| 14 |
- plain: doc2 |
| 15 |
- plain: value2 |
| 16 |
NODE: | |
| 17 |
- kind: Document |
| 18 |
content: |
| 19 |
- kind: Mapping |
| 20 |
style: Plain |
| 21 |
tag: '!!map' |
| 22 |
content: |
| 23 |
- kind: Scalar |
| 24 |
style: Plain |
| 25 |
tag: '!!str' |
| 26 |
text: doc1 |
| 27 |
- kind: Scalar |
| 28 |
style: Plain |
| 29 |
tag: '!!str' |
| 30 |
text: value1 |
| 31 |
- kind: Document |
| 32 |
content: |
| 33 |
- kind: Mapping |
| 34 |
style: Plain |
| 35 |
tag: '!!map' |
| 36 |
content: |
| 37 |
- kind: Scalar |
| 38 |
style: Plain |
| 39 |
tag: '!!str' |
| 40 |
text: doc2 |
| 41 |
- kind: Scalar |
| 42 |
style: Plain |
| 43 |
tag: '!!str' |
| 44 |
text: value2 |
| 45 |
|
| 46 |
- name: Three documents with mixed types |
| 47 |
text: | |
| 48 |
scalar1 |
| 49 |
--- |
| 50 |
- item1 |
| 51 |
- item2 |
| 52 |
--- |
| 53 |
key: value |
| 54 |
node: | |
| 55 |
- plain: scalar1 |
| 56 |
- sequence: |
| 57 |
- plain: item1 |
| 58 |
- plain: item2 |
| 59 |
- mapping: |
| 60 |
- plain: key |
| 61 |
- plain: value |
| 62 |
NODE: | |
| 63 |
- kind: Document |
| 64 |
content: |
| 65 |
- kind: Scalar |
| 66 |
style: Plain |
| 67 |
tag: '!!str' |
| 68 |
text: scalar1 |
| 69 |
- kind: Document |
| 70 |
content: |
| 71 |
- kind: Sequence |
| 72 |
style: Plain |
| 73 |
tag: '!!seq' |
| 74 |
content: |
| 75 |
- kind: Scalar |
| 76 |
style: Plain |
| 77 |
tag: '!!str' |
| 78 |
text: item1 |
| 79 |
- kind: Scalar |
| 80 |
style: Plain |
| 81 |
tag: '!!str' |
| 82 |
text: item2 |
| 83 |
- kind: Document |
| 84 |
content: |
| 85 |
- kind: Mapping |
| 86 |
style: Plain |
| 87 |
tag: '!!map' |
| 88 |
content: |
| 89 |
- kind: Scalar |
| 90 |
style: Plain |
| 91 |
tag: '!!str' |
| 92 |
text: key |
| 93 |
- kind: Scalar |
| 94 |
style: Plain |
| 95 |
tag: '!!str' |
| 96 |
text: value |
| 97 |
|
| 98 |
- name: Documents with anchors and tags |
| 99 |
text: | |
| 100 |
&anchor1 !!str first |
| 101 |
--- |
| 102 |
&anchor2 !!map |
| 103 |
key: value |
| 104 |
node: | |
| 105 |
- anchor: anchor1 |
| 106 |
plain: first |
| 107 |
- anchor: anchor2 |
| 108 |
tag: '!!map' |
| 109 |
mapping: |
| 110 |
- plain: key |
| 111 |
- plain: value |
| 112 |
NODE: | |
| 113 |
- kind: Document |
| 114 |
content: |
| 115 |
- kind: Scalar |
| 116 |
style: Plain |
| 117 |
anchor: anchor1 |
| 118 |
tag: '!!str' |
| 119 |
text: first |
| 120 |
- kind: Document |
| 121 |
content: |
| 122 |
- kind: Mapping |
| 123 |
style: Plain |
| 124 |
anchor: anchor2 |
| 125 |
tag: '!!map' |
| 126 |
content: |
| 127 |
- kind: Scalar |
| 128 |
style: Plain |
| 129 |
tag: '!!str' |
| 130 |
text: key |
| 131 |
- kind: Scalar |
| 132 |
style: Plain |
| 133 |
tag: '!!str' |
| 134 |
text: value |
| 135 |
|
| 136 |
- name: Documents with comments |
| 137 |
text: | |
| 138 |
# comment 1 |
| 139 |
doc1: value1 |
| 140 |
--- |
| 141 |
# comment 2 |
| 142 |
doc2: value2 |
| 143 |
node: | |
| 144 |
- mapping: |
| 145 |
- head: '# comment 1' |
| 146 |
plain: doc1 |
| 147 |
- plain: value1 |
| 148 |
- mapping: |
| 149 |
- head: '# comment 2' |
| 150 |
plain: doc2 |
| 151 |
- plain: value2 |
| 152 |
NODE: | |
| 153 |
- kind: Document |
| 154 |
content: |
| 155 |
- kind: Mapping |
| 156 |
style: Plain |
| 157 |
tag: '!!map' |
| 158 |
content: |
| 159 |
- kind: Scalar |
| 160 |
style: Plain |
| 161 |
tag: '!!str' |
| 162 |
head: '# comment 1' |
| 163 |
text: doc1 |
| 164 |
- kind: Scalar |
| 165 |
style: Plain |
| 166 |
tag: '!!str' |
| 167 |
text: value1 |
| 168 |
- kind: Document |
| 169 |
content: |
| 170 |
- kind: Mapping |
| 171 |
style: Plain |
| 172 |
tag: '!!map' |
| 173 |
content: |
| 174 |
- kind: Scalar |
| 175 |
style: Plain |
| 176 |
tag: '!!str' |
| 177 |
head: '# comment 2' |
| 178 |
text: doc2 |
| 179 |
- kind: Scalar |
| 180 |
style: Plain |
| 181 |
tag: '!!str' |
| 182 |
text: value2 |
| 183 |
|
| 184 |
- name: Five documents |
| 185 |
text: | |
| 186 |
first |
| 187 |
--- |
| 188 |
second |
| 189 |
--- |
| 190 |
third |
| 191 |
--- |
| 192 |
fourth |
| 193 |
--- |
| 194 |
fifth |
| 195 |
node: | |
| 196 |
- plain: first |
| 197 |
- plain: second |
| 198 |
- plain: third |
| 199 |
- plain: fourth |
| 200 |
- plain: fifth |
| 201 |
NODE: | |
| 202 |
- kind: Document |
| 203 |
content: |
| 204 |
- kind: Scalar |
| 205 |
style: Plain |
| 206 |
tag: '!!str' |
| 207 |
text: first |
| 208 |
- kind: Document |
| 209 |
content: |
| 210 |
- kind: Scalar |
| 211 |
style: Plain |
| 212 |
tag: '!!str' |
| 213 |
text: second |
| 214 |
- kind: Document |
| 215 |
content: |
| 216 |
- kind: Scalar |
| 217 |
style: Plain |
| 218 |
tag: '!!str' |
| 219 |
text: third |
| 220 |
- kind: Document |
| 221 |
content: |
| 222 |
- kind: Scalar |
| 223 |
style: Plain |
| 224 |
tag: '!!str' |
| 225 |
text: fourth |
| 226 |
- kind: Document |
| 227 |
content: |
| 228 |
- kind: Scalar |
| 229 |
style: Plain |
| 230 |
tag: '!!str' |
| 231 |
text: fifth |
| 232 |
|
| 233 |
- name: Multiple sequences |
| 234 |
text: | |
| 235 |
- a |
| 236 |
- b |
| 237 |
--- |
| 238 |
- c |
| 239 |
- d |
| 240 |
--- |
| 241 |
- e |
| 242 |
- f |
| 243 |
node: | |
| 244 |
- sequence: |
| 245 |
- plain: a |
| 246 |
- plain: b |
| 247 |
- sequence: |
| 248 |
- plain: c |
| 249 |
- plain: d |
| 250 |
- sequence: |
| 251 |
- plain: e |
| 252 |
- plain: f |
| 253 |
NODE: | |
| 254 |
- kind: Document |
| 255 |
content: |
| 256 |
- kind: Sequence |
| 257 |
style: Plain |
| 258 |
tag: '!!seq' |
| 259 |
content: |
| 260 |
- kind: Scalar |
| 261 |
style: Plain |
| 262 |
tag: '!!str' |
| 263 |
text: a |
| 264 |
- kind: Scalar |
| 265 |
style: Plain |
| 266 |
tag: '!!str' |
| 267 |
text: b |
| 268 |
- kind: Document |
| 269 |
content: |
| 270 |
- kind: Sequence |
| 271 |
style: Plain |
| 272 |
tag: '!!seq' |
| 273 |
content: |
| 274 |
- kind: Scalar |
| 275 |
style: Plain |
| 276 |
tag: '!!str' |
| 277 |
text: c |
| 278 |
- kind: Scalar |
| 279 |
style: Plain |
| 280 |
tag: '!!str' |
| 281 |
text: d |
| 282 |
- kind: Document |
| 283 |
content: |
| 284 |
- kind: Sequence |
| 285 |
style: Plain |
| 286 |
tag: '!!seq' |
| 287 |
content: |
| 288 |
- kind: Scalar |
| 289 |
style: Plain |
| 290 |
tag: '!!str' |
| 291 |
text: e |
| 292 |
- kind: Scalar |
| 293 |
style: Plain |
| 294 |
tag: '!!str' |
| 295 |
text: f |
| 296 |
|
| 297 |
- name: Documents with different scalar styles |
| 298 |
text: | |
| 299 |
plain |
| 300 |
--- |
| 301 |
"double" |
| 302 |
--- |
| 303 |
'single' |
| 304 |
node: | |
| 305 |
- plain: plain |
| 306 |
- double: double |
| 307 |
- single: single |
| 308 |
NODE: | |
| 309 |
- kind: Document |
| 310 |
content: |
| 311 |
- kind: Scalar |
| 312 |
style: Plain |
| 313 |
tag: '!!str' |
| 314 |
text: plain |
| 315 |
- kind: Document |
| 316 |
content: |
| 317 |
- kind: Scalar |
| 318 |
style: Double |
| 319 |
tag: '!!str' |
| 320 |
text: double |
| 321 |
- kind: Document |
| 322 |
content: |
| 323 |
- kind: Scalar |
| 324 |
style: Single |
| 325 |
tag: '!!str' |
| 326 |
text: single |
| 327 |
|
| 328 |
- name: Nested structures across documents |
| 329 |
text: | |
| 330 |
outer: |
| 331 |
inner: |
| 332 |
deep: value1 |
| 333 |
--- |
| 334 |
list: |
| 335 |
- nested: |
| 336 |
item: value2 |
| 337 |
node: | |
| 338 |
- mapping: |
| 339 |
- plain: outer |
| 340 |
- mapping: |
| 341 |
- plain: inner |
| 342 |
- mapping: |
| 343 |
- plain: deep |
| 344 |
- plain: value1 |
| 345 |
- mapping: |
| 346 |
- plain: list |
| 347 |
- sequence: |
| 348 |
- mapping: |
| 349 |
- plain: nested |
| 350 |
- mapping: |
| 351 |
- plain: item |
| 352 |
- plain: value2 |
| 353 |
NODE: | |
| 354 |
- kind: Document |
| 355 |
content: |
| 356 |
- kind: Mapping |
| 357 |
style: Plain |
| 358 |
tag: '!!map' |
| 359 |
content: |
| 360 |
- kind: Scalar |
| 361 |
style: Plain |
| 362 |
tag: '!!str' |
| 363 |
text: outer |
| 364 |
- kind: Mapping |
| 365 |
style: Plain |
| 366 |
tag: '!!map' |
| 367 |
content: |
| 368 |
- kind: Scalar |
| 369 |
style: Plain |
| 370 |
tag: '!!str' |
| 371 |
text: inner |
| 372 |
- kind: Mapping |
| 373 |
style: Plain |
| 374 |
tag: '!!map' |
| 375 |
content: |
| 376 |
- kind: Scalar |
| 377 |
style: Plain |
| 378 |
tag: '!!str' |
| 379 |
text: deep |
| 380 |
- kind: Scalar |
| 381 |
style: Plain |
| 382 |
tag: '!!str' |
| 383 |
text: value1 |
| 384 |
- kind: Document |
| 385 |
content: |
| 386 |
- kind: Mapping |
| 387 |
style: Plain |
| 388 |
tag: '!!map' |
| 389 |
content: |
| 390 |
- kind: Scalar |
| 391 |
style: Plain |
| 392 |
tag: '!!str' |
| 393 |
text: list |
| 394 |
- kind: Sequence |
| 395 |
style: Plain |
| 396 |
tag: '!!seq' |
| 397 |
content: |
| 398 |
- kind: Mapping |
| 399 |
style: Plain |
| 400 |
tag: '!!map' |
| 401 |
content: |
| 402 |
- kind: Scalar |
| 403 |
style: Plain |
| 404 |
tag: '!!str' |
| 405 |
text: nested |
| 406 |
- kind: Mapping |
| 407 |
style: Plain |
| 408 |
tag: '!!map' |
| 409 |
content: |
| 410 |
- kind: Scalar |
| 411 |
style: Plain |
| 412 |
tag: '!!str' |
| 413 |
text: item |
| 414 |
- kind: Scalar |
| 415 |
style: Plain |
| 416 |
tag: '!!str' |
| 417 |
text: value2 |
| 418 |
|
| 419 |
- name: Documents with full metadata |
| 420 |
text: | |
| 421 |
# head1 |
| 422 |
&anchor1 !!str value1 # line1 |
| 423 |
# foot1 |
| 424 |
--- |
| 425 |
# head2 |
| 426 |
&anchor2 !!seq |
| 427 |
- item # line2 |
| 428 |
# foot2 |
| 429 |
--- |
| 430 |
# head3 |
| 431 |
&anchor3 !!map |
| 432 |
key: val # line3 |
| 433 |
# foot3 |
| 434 |
node: | |
| 435 |
- foot: '# foot1' |
| 436 |
anchor: anchor1 |
| 437 |
head: '# head1' |
| 438 |
line: '# line1' |
| 439 |
plain: value1 |
| 440 |
- foot: '# foot2' |
| 441 |
anchor: anchor2 |
| 442 |
tag: '!!seq' |
| 443 |
sequence: |
| 444 |
- head: '# head2' |
| 445 |
line: '# line2' |
| 446 |
plain: item |
| 447 |
- anchor: anchor3 |
| 448 |
tag: '!!map' |
| 449 |
mapping: |
| 450 |
- head: '# head3' |
| 451 |
foot: '# foot3' |
| 452 |
plain: key |
| 453 |
- line: '# line3' |
| 454 |
plain: val |
| 455 |
NODE: | |
| 456 |
- kind: Document |
| 457 |
foot: '# foot1' |
| 458 |
content: |
| 459 |
- kind: Scalar |
| 460 |
style: Plain |
| 461 |
anchor: anchor1 |
| 462 |
tag: '!!str' |
| 463 |
head: '# head1' |
| 464 |
line: '# line1' |
| 465 |
text: value1 |
| 466 |
- kind: Document |
| 467 |
foot: '# foot2' |
| 468 |
content: |
| 469 |
- kind: Sequence |
| 470 |
style: Plain |
| 471 |
anchor: anchor2 |
| 472 |
tag: '!!seq' |
| 473 |
content: |
| 474 |
- kind: Scalar |
| 475 |
style: Plain |
| 476 |
tag: '!!str' |
| 477 |
head: '# head2' |
| 478 |
line: '# line2' |
| 479 |
text: item |
| 480 |
- kind: Document |
| 481 |
content: |
| 482 |
- kind: Mapping |
| 483 |
style: Plain |
| 484 |
anchor: anchor3 |
| 485 |
tag: '!!map' |
| 486 |
content: |
| 487 |
- kind: Scalar |
| 488 |
style: Plain |
| 489 |
tag: '!!str' |
| 490 |
head: '# head3' |
| 491 |
foot: '# foot3' |
| 492 |
text: key |
| 493 |
- kind: Scalar |
| 494 |
style: Plain |
| 495 |
tag: '!!str' |
| 496 |
line: '# line3' |
| 497 |
text: val |
| 498 |
|
| 499 |
- name: Documents with integers and special values |
| 500 |
text: | |
| 501 |
42 |
| 502 |
--- |
| 503 |
3.14 |
| 504 |
--- |
| 505 |
true |
| 506 |
--- |
| 507 |
null |
| 508 |
node: | |
| 509 |
- plain: '42' |
| 510 |
- plain: '3.14' |
| 511 |
- plain: 'true' |
| 512 |
- plain: 'null' |
| 513 |
NODE: | |
| 514 |
- kind: Document |
| 515 |
content: |
| 516 |
- kind: Scalar |
| 517 |
style: Plain |
| 518 |
tag: '!!int' |
| 519 |
text: '42' |
| 520 |
- kind: Document |
| 521 |
content: |
| 522 |
- kind: Scalar |
| 523 |
style: Plain |
| 524 |
tag: '!!float' |
| 525 |
text: '3.14' |
| 526 |
- kind: Document |
| 527 |
content: |
| 528 |
- kind: Scalar |
| 529 |
style: Plain |
| 530 |
tag: '!!bool' |
| 531 |
text: 'true' |
| 532 |
- kind: Document |
| 533 |
content: |
| 534 |
- kind: Scalar |
| 535 |
style: Plain |
| 536 |
tag: '!!null' |
| 537 |
text: 'null' |
| 538 |
|
| 539 |
- name: Documents with flow style |
| 540 |
text: | |
| 541 |
{key1: value1} |
| 542 |
--- |
| 543 |
[item1, item2] |
| 544 |
node: | |
| 545 |
- mapping: |
| 546 |
- plain: key1 |
| 547 |
- plain: value1 |
| 548 |
- sequence: |
| 549 |
- plain: item1 |
| 550 |
- plain: item2 |
| 551 |
NODE: | |
| 552 |
- kind: Document |
| 553 |
content: |
| 554 |
- kind: Mapping |
| 555 |
style: Flow |
| 556 |
tag: '!!map' |
| 557 |
content: |
| 558 |
- kind: Scalar |
| 559 |
style: Plain |
| 560 |
tag: '!!str' |
| 561 |
text: key1 |
| 562 |
- kind: Scalar |
| 563 |
style: Plain |
| 564 |
tag: '!!str' |
| 565 |
text: value1 |
| 566 |
- kind: Document |
| 567 |
content: |
| 568 |
- kind: Sequence |
| 569 |
style: Flow |
| 570 |
tag: '!!seq' |
| 571 |
content: |
| 572 |
- kind: Scalar |
| 573 |
style: Plain |
| 574 |
tag: '!!str' |
| 575 |
text: item1 |
| 576 |
- kind: Scalar |
| 577 |
style: Plain |
| 578 |
tag: '!!str' |
| 579 |
text: item2 |
| 580 |
|
| 581 |
- name: Multiple sequences with explicit markers (no duplicates) |
| 582 |
text: | |
| 583 |
- 1 |
| 584 |
--- |
| 585 |
- 2 |
| 586 |
explicit-yaml: | |
| 587 |
--- |
| 588 |
- 1 |
| 589 |
... |
| 590 |
--- |
| 591 |
- 2 |
| 592 |
... |