Mitto v2.9 Sneak Peek - Job Configs - Hjson support

Mitto v2.9 is adding Hjson support for job configs. Hjson has many interesting features, but most importantly it supports commenting in JSON. This new feature will allow Mitto users to make inline comments in their job configs!

Pre Mitto v2.9, job configs are stored as JSON. When a user edits a job, they are presented with a JSON editor.

Here’s an example job config (this isn’t a real Mitto job, but it shows the JSON):

And here’s the raw JSON:

{
  "key": 1,
  "contains": "everything on this line",
  "cool": {
    "foo": 1,
    "bar": 2
  },
  "list": [
    1,
    2
  ],
  "realist": "My half empty glass,\nI will fill your empty half.\nNow you are half full."
}

In Mitto v2.9, this same job config can be JSON or Hjson.

Here’s the same example, but with all the benefits of Hjson:

And here’s the raw Hjson:

{
  // use #, // or /**/ comments,
  // omit quotes for keys
  key: 1
  // omit quotes for strings
  contains: everything on this line
  // omit commas at the end of a line
  cool: {
    foo: 1
    bar: 2
  }
  // allow trailing commas
  list: [
    1,
    2,
  ]
  // and use multiline strings
  realist:
    '''
    My half empty glass,
    I will fill your empty half.
    Now you are half full.
    '''
}

Hjson additional reading:

Disclaimer: Content discussed in this thread is subject to change pending product release.

Here’s an example job created from the Query plugin wizard in Mitto v2.9:

SQL:

Notice the use of single and multiline comments in the SQL statement.
image

JSON:

Notice the comment in the JSON (line 2), the lack of double quotes around keys and strings, and the lack of commas between key/value pairs.
The sql value is a multi line string and can be copied and pasted easily now.

@benzuar, you can use this hjson editor to convert hjson to json or vice versa: Hjson, a user interface for JSON