YAML to JSONConverters
Turns YAML configuration into JSON.
Check YAML for syntax errors as you type, then rewrite it with consistent indentation. Errors show the line and column with a hint for the usual culprits: tabs, bad indentation, and stray colons.
.yaml or .yml file. It is checked as you type.The input is parsed with js-yaml using the YAML 1.2 core schema, the same rules most modern tools follow.
--- lines.name: web image: nginxis invalid:
image is indented more than name but name already has a value. Fix: line the keys up.title: Error: not found is invalid, because the second : starts another mapping. Fix: quote the value, title: "Error: not found".port on two lines, gives a duplicated mapping key error.services: {web: {ports: [80, 443]}} is valid, and formatting with 2 spaces gives:services:
web:
ports:
- 80
- 443Valid YAML can still contain a value of the wrong type for the application that reads it. These three entries all pass the syntax check:
enabled: false quoted_enabled: "false" label: no
Here, enabled is a boolean. quoted_enabled and label are strings under this parser's YAML 1.2 core rules. Quotes preserve text even when it looks like a boolean.
Use YAML to JSON to inspect the parsed values. Then check the application's own configuration rules. For example, replicas: "three" is valid YAML syntax, but this validator does not establish whether an application accepts that value.
!Ref and !Sub in CloudFormation, or !reference in GitLab CI, are reported as unknown tags.Not for indentation. YAML only allows spaces there. Tabs are fine inside quoted strings.
Older YAML 1.1 parsers read yes, no, on, and off as booleans. This tool uses YAML 1.2, where only true and false are booleans, but it quotes such words when formatting so older tools read them as text too.
No. Comments are dropped when the YAML is rewritten. Validation alone never changes your input.
Often used together with YAML Validator & Formatter.
Turns YAML configuration into JSON.
Turns JSON into readable YAML for configuration files.
Converts YAML documents into well-formed, indented XML.