Comment on Show me a better text format for serializing

<- View Parent
kogasa@programming.dev ⁨11⁩ ⁨months⁩ ago

If a comment isn’t part of the semantic content of a JSON object it has no business being there. JSON models data, it’s not markup language for writing config files.

You can use comments in JSON schema (in a standardized way) when they are semantically relevant: json-schema.org/…/comments

For the data interchange format, comments aren’t part of the JSON grammar but the option to parse non-JSON values is left open to the implementation. Many implementations do detect (and ignore) comments indicated by e.g. # or //.

source
Sort:hotnewtop