You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presently comments are discarded when reading data and and writing data out. This allows for full compatibility with plain-JSON, but it would be nice if comments were handled.
In plain-JSON a common workaround is to use //
{
"//": "comment",
"example": "value"
}
If comments occur within JSON5-objects this convention could be formalised for JSON5<->plain-JSON mapping. JSON5 comments would be converted to and from String-JsonPrimitives with a key of // (this would need to be unique)..
{// comment"example": "value"}
When comments are not easily mapped to an object value (they're in arrays, or outside of an object) I'm not sure what can be done.
The text was updated successfully, but these errors were encountered:
aSemy
changed the title
Support comments
Support converting JSON5 comments to JSON object fields
Dec 22, 2021
Presently comments are discarded when reading data and and writing data out. This allows for full compatibility with plain-JSON, but it would be nice if comments were handled.
In plain-JSON a common workaround is to use
//
If comments occur within JSON5-objects this convention could be formalised for JSON5<->plain-JSON mapping. JSON5 comments would be converted to and from String-
JsonPrimitive
s with a key of//
(this would need to be unique)..When comments are not easily mapped to an object value (they're in arrays, or outside of an object) I'm not sure what can be done.
The text was updated successfully, but these errors were encountered: