22 chars · 2 lines
Waiting for input
22 chars · 2 lines
Waiting for input
YAML directive troubleshooting
The sample declares %YAML 1.2 and immediately starts a service mapping. Once a directive section is present, YAML expects --- to mark the start of the following document body. This tool is free to use. No account or payment is required.
Last updated
Percent-prefixed directives provide parser instructions before a document. The explicit document start marker tells the parser where those instructions end and the data begins.
If a directive was copied from an example without a real compatibility requirement, removing it can be simpler. Keep it only when the consuming workflow benefits from the explicit stream metadata.
Insert --- between the %YAML directive and the service mapping.
%YAML 1.2
service: api%YAML 1.2
---
service: apiCommon questions
It is the explicit document start marker and is required after a directive section before that document begins.
Usually not. Many configuration files omit directives entirely and rely on the parser's supported YAML version.
A directive section may contain supported directives, but it still needs an explicit --- marker before document content starts.
Debugging a specific YAML issue? Browse YAML troubleshooting.