31 chars · 1 line
Waiting for input
31 chars · 1 line
Waiting for input
YAML flow mapping troubleshooting
The sample opens a service mapping with { and provides two pairs but never closes the collection. Flow mappings use an explicit } boundary, so reaching the end of the line or file is not enough. This tool is free to use. No account or payment is required.
Last updated
Flow mappings are compact equivalents of block mappings, but their boundaries come from braces rather than indentation. Missing one delimiter leaves the parser inside the collection.
A mapping with several configuration fields is often clearer with one key per line. Rewriting to block style can make future edits less dependent on matching punctuation correctly.
Close the service mapping after its final port pair.
service: {name: api, port: 8080service: {name: api, port: 8080}Common questions
It can. Curly braces define flow-style mappings, while block mappings usually place key/value pairs on indented lines without braces.
Yes, but the opening { still requires a matching } and the internal pairs must follow flow collection syntax.
Either representation can be valid. Block style is often easier to maintain when the mapping contains many fields.
Debugging a specific YAML issue? Browse YAML troubleshooting.