Convert YAML to PROPERTIES

Turn YAML 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 YAML files on the dialor turn it to pick what to do

YAML turned into flat Java properties.Each value gets one key=value line, named by its path of keys.

  1. What you get

    One PROPERTIES file in which every value is a single key=value line with Java escapes. The key is the path of keys joined with dots, and list positions go in brackets, such as server.hosts[0].

    A top-level list is written under items, such as items[0].name. An empty object or list is written as JSON text.

  2. What changes

    Comments are dropped. Aliases are expanded, so each place an alias was used gets its own copy of the value.

    Several documents in one YAML file become a list. Values such as yes, on, 0755 and dates stay text, so they are written as they appear and not turned into booleans, numbers or dates.

    A merge key (<<) is not merged. It is kept as an ordinary key, so its content appears under a key named <<.

  3. When it stops

    The conversion stops with input_corrupted when the YAML file cannot be parsed. It stops with unsupported_elements when the file holds something PROPERTIES cannot carry, or when some inputs cannot become the format the join takes.

    To go the other way, use PROPERTIES to YAML.

YAML and PROPERTIES.What each format is.

The formats

From · YAML

YAML

YAML configuration and data files.

Extensions
.yaml .yml
MIME type
application/yaml
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 YAML to PROPERTIES conversion through the API, for your app or your agent.

terminal
$ cv convert report.yaml report.properties
$ cv convert report.yaml report.properties

Questions.What people ask about YAML to PROPERTIES.

01OF 04

The keys are joined with dots, and list positions go in brackets. A list under server.hosts gives lines such as server.hosts[0].

No. Comments in the YAML file are dropped.

Yes. The list is written under items, so the first entry's name becomes items[0].name.

No. Values such as yes, on, 0755 and dates stay text.

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