From bb63342cc0217ef74b0c70b3fed8486fe97d0572 Mon Sep 17 00:00:00 2001 From: Juha-Matti Tilli Date: Sun, 14 Jun 2026 17:10:16 +0300 Subject: [PATCH] Add CAJ to the set of libraries supporting JSONC as the first C implementation --- tools.md | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools.md b/tools.md index f78d246..b6c8547 100644 --- a/tools.md +++ b/tools.md @@ -11,15 +11,16 @@ Several tools and libraries support JSONC, enabling developers to parse and gene | Language | Tool/Library | Comments | Trailing Commas | Notes | |----------- |---------------------------------------------------|----------|-----------------|--------------------------------| -| C++ | [nlohmann/json][nlohmann] | 🟡 [^1] | 🟡 [^2] | | -| C++ | [RapidJSON][rapidjson] | 🟡 [^3] | 🟡 [^4] | | -| C++ | [stephenberry/glaze][glaze] | 🟢 [^5] | 🔴 | | +| C | [jmtilli/caj][CAJ] | 🟡 [^1] | 🟡 [^2] | | +| C++ | [nlohmann/json][nlohmann] | 🟡 [^3] | 🟡 [^4] | | +| C++ | [RapidJSON][rapidjson] | 🟡 [^5] | 🟡 [^6] | | +| C++ | [stephenberry/glaze][glaze] | 🟢 [^7] | 🔴 | | | Elixir | [massivefermion/jsonc][massivefermion] | 🟢 | 🟢 | Includes additional extensions | | Go | [HuJSON][hujson] | 🟢 | 🟢 | | | Go | [tidwall/jsonc][tidwall] | 🟢 | 🟢 | | -| Java | [Jackson][Jackson] | 🟡 [^6] | 🟡 [^7] | | -| JavaScript | [microsoft/node-jsonc-parser][msft] | 🟢 | 🟡 [^8] | | -| Kotlin | [kotlinx.serialization.json][kotlinx] | 🟡 [^9] | 🟡 [^10] | | +| Java | [Jackson][Jackson] | 🟡 [^8] | 🟡 [^9] | | +| JavaScript | [microsoft/node-jsonc-parser][msft] | 🟢 | 🟡 [^10] | | +| Kotlin | [kotlinx.serialization.json][kotlinx] | 🟡 [^11] | 🟡 [^12] | | | PHP | [otar/jsonc][otar] | 🟢 | 🟢 | | | Python | [n-takumasa/json-with-comments][n-takumasa] | 🟢 | 🟢 | | | Rust | [dprint/jsonc-parser][dprint] | 🟢 | 🟢 | | @@ -36,6 +37,7 @@ Legend: [hujson]: https://github.com/tailscale/hujson [rapidjson]: https://github.com/Tencent/rapidjson [nlohmann]: https://github.com/nlohmann/json +[CAJ]: https://github.com/jmtilli/caj [glaze]: https://github.com/stephenberry/glaze [tidwall]: https://github.com/tidwall/jsonc [Jackson]: https://github.com/FasterXML/jackson-core @@ -47,22 +49,26 @@ Legend:
-[^1]: Use `ignore_comments` +[^1]: Use `caj_allow_comments(ctx)` -[^2]: Use `ignore_trailing_commas` +[^2]: Use `caj_allow_trailing_comma(ctx)` -[^3]: Use `kParseCommentsFlag` +[^3]: Use `ignore_comments` -[^4]: Use `kParseTrailingCommasFlag` +[^4]: Use `ignore_trailing_commas` -[^5]: Use `glz::read_jsonc` (or using options: `glz::opts{.comments = true}`). See [Documentation](https://github.com/stephenberry/glaze/blob/main/docs/json.md#json-with-comments-jsonc). +[^5]: Use `kParseCommentsFlag` -[^6]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)` +[^6]: Use `kParseTrailingCommasFlag` -[^7]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_TRAILING_COMMA)` +[^7]: Use `glz::read_jsonc` (or using options: `glz::opts{.comments = true}`). See [Documentation](https://github.com/stephenberry/glaze/blob/main/docs/json.md#json-with-comments-jsonc). -[^8]: Use `allowTrailingComma: true` +[^8]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)` -[^9]: Use `allowComments`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-comments.html). +[^9]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_TRAILING_COMMA)` -[^10]: Use `allowTrailingComma`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-trailing-comma.html). \ No newline at end of file +[^10]: Use `allowTrailingComma: true` + +[^11]: Use `allowComments`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-comments.html). + +[^12]: Use `allowTrailingComma`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-trailing-comma.html).