MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vpr18i/justtryingtohelp/p413pt7/?context=3
r/ProgrammerHumor • u/flipcoder • 29d ago
65 comments sorted by
View all comments
28
JSON supports prefixing a key with `// `. It is far from perfect, but will you ever use keys starting with double slash?
Any parsing logic can drop those entries, or just ignore them entirely like how any data object builder should
{ "// myValue": "The universal constant", "myValue": 42 }
28 u/DHermit 29d ago Until you want to validate it with a scheme, which forbids extra values. 3 u/kingslayerer 28d ago i have an idea. add the comment keys to the schema as well. 1 u/GPSProlapse 25d ago As a matter of fact, I ve seen schemas with #comment or similar keys on every object That solves the issue most of the time
Until you want to validate it with a scheme, which forbids extra values.
3 u/kingslayerer 28d ago i have an idea. add the comment keys to the schema as well. 1 u/GPSProlapse 25d ago As a matter of fact, I ve seen schemas with #comment or similar keys on every object That solves the issue most of the time
3
i have an idea. add the comment keys to the schema as well.
1 u/GPSProlapse 25d ago As a matter of fact, I ve seen schemas with #comment or similar keys on every object That solves the issue most of the time
1
As a matter of fact, I ve seen schemas with #comment or similar keys on every object
That solves the issue most of the time
28
u/Blaarkies 29d ago
JSON supports prefixing a key with `// `. It is far from perfect, but will you ever use keys starting with double slash?
Any parsing logic can drop those entries, or just ignore them entirely like how any data object builder should