centraldogma icon indicating copy to clipboard operation
centraldogma copied to clipboard

Support JSON5

Open trustin opened this issue 3 years ago • 6 comments

https://json5.org/

JSON5 is a superset of JSON which adds some nice-to-haves to JSON, such as comments, trailing commas in arrays, etc. Will be useful for those who write configuration in JSON.

Related: #151

trustin avatar Sep 28 '20 04:09 trustin

It seems like if we enable some features of Jackson parser, we can use most of the features of JSON5. https://stackoverflow.com/questions/68312227/can-the-jackson-parser-be-used-to-parse-json5

minwoox avatar Nov 03 '21 06:11 minwoox

Let me handle this issue 🤚.

ks-yim avatar Nov 22 '21 05:11 ks-yim

It seems like the PR is still stale after 2 years. Is there any initiative to complete this issue?

I can try to take over the PR next week if needed.

Dogacel avatar Mar 01 '24 14:03 Dogacel

Hi! We need to implement the v2 API before proceeding with JSON5 and YAML support. Otherwise, the server won't be able to determine if the client can handle JSON5 and YAML. https://github.com/line/centraldogma/pull/655#issuecomment-1510935762

Are you interested in implementing V2 API? 😉

minwoox avatar Mar 04 '24 13:03 minwoox

Hi! We need to implement the v2 API before proceeding with JSON5 and YAML support. Otherwise, the server won't be able to determine if the client can handle JSON5 and YAML. #655 (comment)

Are you interested in implementing V2 API? 😉

Hmm maybe I am missing some context. What changes are planned in V2 API?

Also one thing I wonder is whether just supplying a custom ObjectMapper would be enough to support JSON5? In the end, it is all about adding, converting or ignoring some characters from JSON, right?

Dogacel avatar Mar 04 '24 15:03 Dogacel

Also one thing I wonder is whether just supplying a custom ObjectMapper would be enough to support JSON5?

The current client, which will become the old client once JSON5 support is added, cannot handle a JSON5 file. Because of that, the server cannot just send a JSON5 file to the client. The client will get a parsing exception. Therefore, if the client wants to use JSON5, the client must utilize a different API, which will be V2.

What changes are planned in V2 API?

The V1 API will read JSON5 file as JSON file and YAML file as a TEXT file. Meanwhile, the V2 API will read the files as they are.

minwoox avatar Mar 06 '24 03:03 minwoox