Kotlin / kotlinx.serialization

Kotlin multiplatform / multi-format serialization
Apache License 2.0
5.34k stars 618 forks source link

Support python style (`#`) comments #2679

Open rnett opened 4 months ago

rnett commented 4 months ago

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 #.

sandwwraith commented 4 months ago

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.

rnett commented 4 months ago

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