Convert JSONC to PROPERTIES

Turn JSONC files into PROPERTIES. Each value becomes one key=value line with Java escapes, under its path of keys joined with dots and list positions in brackets, such as server.hosts[0], and a top-level list is written under items, such as items[0].name.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop JSONC files on the dialor turn it to pick what to do

Flat key=value lines from JSONC.Every value gets its own line, named by its path through the data.

  1. What you get

    One PROPERTIES file. Each value becomes a single key=value line with Java escapes. The key is the path of keys leading to the value, joined with dots.

    Positions in a list go in brackets, so a value can end up as server.hosts[0]. A list at the top level has no key to sit under, so it is written under items, such as items[0].name.

  2. What it leaves behind

    Comments are dropped. They have no place in the key=value lines, so notes in your editor or TypeScript configuration file do not carry over. Trailing commas are dropped too.

    An empty object or list has no values to write lines for. It is written as JSON text instead.

  3. Going back

    The nesting is stored in the key names, not in the structure of the file. To turn a PROPERTIES file into JSONC again, use PROPERTIES to JSONC.

JSONC and PROPERTIES.What each format is.

The formats

From · JSONC

JSON with Comments

JSON that allows comments, as in editor and TypeScript configuration files.

Extensions
.jsonc
MIME type
text/x-jsonc
Kind
Text and data
To · PROPERTIES

Java Properties

Key and value pairs in the Java properties format.

Extensions
.properties
MIME type
text/x-java-properties
Kind
Text and data

In your code.The same JSONC to PROPERTIES conversion through the API, for your app or your agent.

terminal
$ cv convert report.jsonc report.properties
$ cv convert report.jsonc report.properties

Questions.What people ask about JSONC to PROPERTIES.

01OF 04

Keys are joined with dots, so a value inside server is named server.something. Positions in a list are written in brackets, such as server.hosts[0].

It is written under items. The name of the first entry then reads items[0].name, for example.

No. Comments are dropped, and so are trailing commas.

As JSON text on its line, since there are no values inside it to write out.

More conversions.Other ways in and out of JSONC and PROPERTIES.