A YAML stream may contain multiple documents separated by ---, but VetaTool's YAML workspace validates one document at a time. A second document is therefore reported instead of silently ignored.
28 chars · 3 lines
Waiting for input
Loading YAML parser…
YAML document boundary troubleshooting
How to handle multiple YAML documents when one is expected
The preloaded input contains two YAML documents separated by ---. YAML itself supports document streams, but this validator intentionally checks a single document so a second document boundary is surfaced instead of being mistaken for part of one configuration object. This tool is free to use. No account or payment is required.
Last updated
What you can do here
YAML 1.2 parser validation
Duplicate mapping key detection
Preloaded broken YAML example
Readable parser feedback
.yaml and .yml file import
Browser-local processing
Steps
Search the source for --- document-start markers after the first document begins.
Confirm whether the consuming application expects one document or a YAML stream.
Validate documents separately or convert the intended collection into one YAML structure, then check again.
YAML streams and YAML documents are different layers
The YAML format can represent a stream containing more than one document. Application APIs often accept only one parsed document, so support for YAML syntax does not automatically mean support for multi-document input.
Do not remove separators from deployment bundles blindly
Some ecosystems intentionally use --- to place several resources in one file. If that is the source format you need, process the stream with a multi-document-aware consumer rather than concatenating mappings and accidentally changing their meaning.
Two YAML documents versus one collection
The corrected example represents both names inside one YAML document instead of starting a second document.
Multiple documents
name: first
---
name: second
Single-document alternative
documents:
- name: first
- name: second
Common questions
Frequently asked questions
What does --- mean in YAML?
At the start of a line, --- is a document-start marker and can separate documents in a YAML stream.
Are multiple YAML documents invalid YAML?
No. YAML streams can contain multiple documents, but a parser or application configured for a single document may reject the extra documents.
Why does VetaTool reject the second document?
The YAML workspace uses single-document parsing so validation matches tools that expect one configuration document at a time.