kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Support python style (`#`) comments

Open rnett opened this issue 1 year ago • 2 comments

What is your use-case and why do you need this feature?

The new comments feature in 1.7.0-RC is great! However, most of the time when I've encountered JSON with comments, they use #. I'm not sure why, tbh.

Describe the solution you'd like For the existing comment support to also include comments starting with #.

rnett avatar May 16 '24 17:05 rnett

To be honest, it is the first time I have heard that # is used in Json for comments. Perhaps it has something to do with # being a comment in YAML and YAML being a superset of Json. At least, Jackson has a separate setting for this that is called ALLOW_YAML_COMMENTS.

sandwwraith avatar May 16 '24 18:05 sandwwraith

That seems likely. A separate setting would work fine for me.

rnett avatar May 16 '24 22:05 rnett