excubo-ag / WebCompiler

Apache License 2.0
148 stars 29 forks source link

[Feature] Allow comments in config #84

Closed lonix1 closed 6 months ago

lonix1 commented 8 months ago

The parser chokes when webcompilerconfiguration.json contains comments:

Error reading configuration from file: '/' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

This is very unfortunate, because it's extremely helpful to add comments explaining what the various options are, the valid values, links to the docs site, etc.

Most modern json tooling allows comments.

I assume the underlying parser used by this library allows it, because it already allows "trailing commas".

Please allow use of comments?

Thanks, and appreciate this library!

stefanloerwald commented 8 months ago

Hi @lonix1

This project uses System.Text.Json, which according to https://stackoverflow.com/a/59447230 can be enabled to allow comments. I won't have the time to change this behaviour soon, but reviewing a pull request will be much quicker. Would you be interested in contributing this?

Thanks, Stefan

lonix1 commented 8 months ago

I've no experience in that sort of thing, so I doubt it. But I may take a look and maybe I'll learn something new.

If I can't manage, maybe someone else will stumble on this issue and help with a PR... I hope :smile: