Skip to content
YAML

Block Style

Indentation-based nesting.

By EZ4Code Team
blockindentation

Code

server:
  host: localhost
  port: 8080
  routes:
    home:
      path: /
      method: GET
    api:
      path: /api
      method: POST
      auth: required

Explanation

Block style expresses nesting through indentation, which must be consistent spaces (tabs are forbidden). Deeper indent means a child of the preceding less-indented key. Block style is the most readable form for configuration and is the default for most YAML files.

More YAML Snippets