Cpanel-JSON-XS icon indicating copy to clipboard operation
Cpanel-JSON-XS copied to clipboard

JS-style comments

Open melo opened this issue 1 year ago • 5 comments

Hello,

This is more of a RFC, but could we add support for //-style comments when using "relaxed"-mode?

I believe this would be better for interoperability with other systems where JSON-with-comments used the JS version of single line comments and not the shell version.

If this is something that would be accepted, I would like to try and implement it. I've never used XS and this might be a small project to start (famous last words, I know...).

Thank you.

melo avatar Dec 08 '23 11:12 melo

Sorry, but for this you need to ask upstream. Personally I am in favor to not reject such comments in the decoder

rurban avatar Dec 08 '23 19:12 rurban

Sorry, but for this you need to ask upstream. Personally I am in favor to not reject such comments in the decoder

Out of curiosity, by upstream do you mean the JSON::XS repo? I'd consider trying to write the code for it in the next few weeks since I run up against this limitation often, but I can't guarantee anything

cmburn avatar May 29 '24 17:05 cmburn

Upstream is JSON::PP of course, which is also in core

rurban avatar May 29 '24 21:05 rurban

Ope, my bad! Would I send a pull request to https://github.com/makamaka/JSON-PP or the main Perl repo? I appreciate it, sorry for all the questions.

cmburn avatar May 29 '24 21:05 cmburn

JSON::PP is CPAN-upstream so that JSON-PP repository is the correct place.

Grinnz avatar May 29 '24 21:05 Grinnz