3 ms·
> There are no comments, so nobody will try to invent their own meta format or annotations in comments and instead they will put data in the JSON as they should
by Ygg2 4y ago
> There are no comments, so nobody will try to invent their own meta format or annotations in comments and instead they will put data in the JSON as they should
It also means it's worse format for configs where you sometimes need to annotate a few nodes with comments.
- lttlrck 4y agoYep. "comment": gets littered across the JSON... or temporary changes are copied and the original property name is invalidate with a prefix. The simple structure is gone, replaced with adhoc workarounds. Similarly when you want to use a type not supported by JSON such as datetime or binary data, you might end up with "type":"binary" and use base64 or whatever in the value (shoehorning attribs) - when it really needs a schema to follow during parse and stringify. Or OpenAPI, which is hardly lightweight and really doesn't match the simplicity of JSON.
- hiccuphippo 4y agoFor configuration files I add an extra key "_" and a string with the comment as the value. I even add multiple "_" keys to the same object and never seen something break.
- IshKebab 4y agoThis is just a terrible comment format isn't it?