Convert YAML to CBOR

Turn YAML files into CBOR. The same structure and key order in CBOR, with integers, floats, booleans, null, text, arrays and maps keeping their types and dates as text.

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 structure, written as CBOR.Keys keep their order, and values keep their types.

  1. What you get

    One CBOR file with the same structure and key order as the YAML. Integers, floats, booleans, null, text, arrays and maps keep their types.

    Dates are stored as text, not as a date type.

  2. What changes

    If the YAML holds several documents, they become a list in the CBOR file. Aliases are expanded, so each place that used an alias holds its own copy of the value.

    Comments are dropped.

  3. Values that stay text

    Values such as yes, on, 0755 and dates stay text. They are not turned into booleans or numbers.

    A merge key (<<) is kept as an ordinary key. The keys it points to are not merged into the map around it.

  4. When it fails

    The conversion stops with input_corrupted when the YAML file cannot be parsed. To go the other way, use CBOR to YAML.

YAML and CBOR.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 · CBOR

CBOR

Concise Binary Object Representation, the binary JSON of IoT and web standards.

Extensions
.cbor
MIME type
application/cbor
Kind
Text and data

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

terminal
$ cv convert report.yaml report.cbor
$ cv convert report.yaml report.cbor

Questions.What people ask about YAML to CBOR.

01OF 04

Yes. The structure and the key order stay the same as in the YAML.

They are dropped. The CBOR file holds only the data.

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

The documents become a list in the CBOR file. You still get one file.

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