JSON configuration rather than YML

I have had so many issues with configuration due to the unnecessary imposing and contradictive whitespace rules of YML.

For instance, having to indent with exactly two spaces, apart from when the section is a named list, in which case you use four spaces.

For someone who writes code in a language that uses braces to indicate their block level, which is the same case for the structure of JSON, using YML feels worse than writing XML by hand.

JSON is very popular and I can't see a reason as to not use it for configuration, at least as an option.

  • Guest
  • Jun 14 2018
  • Duplicate
  • Attach files
  • Nathan Dintenfass commented
    June 14, 2018 16:33

    YAML is a superset of JSON, so in almost all cases you should be able to write JSON. As long as the data is shaped in the same way it will work. We don't recommend this, as in most cases it's harder to read and won't look like our documentation, but the underlying YAML parser will see your JSON string as YAML and pass it through correctly. If you see anomalies to this we'd be curious to hear about them. 

    For instance, I tried to run a build with this as the config, and it worked the same as if it were written in the YAML-ized format:

    "version": 2,
    "jobs": {
    "build": {
    "docker": [
    "image": "circleci/ruby:2.5.1-node-browsers"
    "steps": [
    "run": "echo thing"
  • a m commented
    June 14, 2018 11:18

    Please, don't. Using JSON as a config file format is a very bad idea: JSON is a machine interchange format, and it's terrible as a config file format. Config files should be readable, have comments, and not being strict. JSON is nothing like that.

  • Chris Shaw commented
    June 14, 2018 08:23