31 chars · 1 line
Waiting for input
31 chars · 1 line
Waiting for input
YAML flow mapping troubleshooting
The sample places name and port inside one curly-brace mapping but omits the comma between the two pairs. Flow mappings need punctuation to mark where one key/value entry ends and the next begins. This tool is free to use. No account or payment is required.
Last updated
Curly-brace mappings compress YAML structure onto one line. That saves space, but it also means commas and braces carry more of the structural information that indentation would provide in block style.
For configuration objects with several fields, one key per line often makes code review clearer and reduces the chance of losing a comma while inserting a new field.
A comma is required between the api value and the port key.
service: {name: api port: 8080}service: {name: api, port: 8080}Common questions
No. Block mappings use line structure and indentation. Commas are required between pairs in flow mappings written inside curly braces.
It is visually similar, but YAML has its own scalar and key rules. Use the YAML parser rather than assuming every JSON-like fragment has identical semantics.
Yes when it represents the same mapping value. Block style can be easier to edit when the object contains several fields.
Debugging a specific YAML issue? Browse YAML troubleshooting.