Skip to content
configkit

Why comments disappear

JSON has no comment syntax. A conversion rebuilds the document from values, so the comments are not in the output.

The example

A YAML or TOML comment is dropped. The status says so. The values underneath are kept.

# keep this out of the JSON
service: configkit

The JSON is {"service":"configkit"} in compact form, without the comment. Pasting a comment into JSON itself is a syntax error, and the tool writes no output.

The edge case

A # inside a quoted string is part of the value. It is not treated as a comment, and it is not dropped.

note: "issue #14"

Try it on YAML to JSON or TOML to JSON.