|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: JSONC |
| 4 | +--- |
| 5 | + |
| 6 | +# Tools and Libraries |
| 7 | + |
| 8 | +Several tools and libraries support JSONC, enabling developers to parse and generate JSONC data easily. This is a non-exhaustive list organized by programming language. |
| 9 | + |
| 10 | +## Parsers |
| 11 | + |
| 12 | +| Language | Tool/Library | Comments | Trailing Commas | Notes | |
| 13 | +|----------- |---------------------------------------------------|----------|-----------------|--------------------------------| |
| 14 | +| C++ | [nlohmann/json][nlohmann] | 🟡 [^1] | 🟡 [^2] | | |
| 15 | +| C++ | [RapidJSON][rapidjson] | 🟡 [^3] | 🟡 [^4] | | |
| 16 | +| C++ | [stephenberry/glaze][glaze] | 🟢 [^5] | 🔴 | | |
| 17 | +| Elixir | [massivefermion/jsonc][massivefermion] | 🟢 | 🟢 | Includes additional extensions | |
| 18 | +| Go | [HuJSON][hujson] | 🟢 | 🟢 | | |
| 19 | +| Go | [tidwall/jsonc][tidwall] | 🟢 | 🟢 | | |
| 20 | +| Java | [Jackson][Jackson] | 🟡 [^6] | 🟡 [^7] | | |
| 21 | +| JavaScript | [microsoft/node-jsonc-parser][msft] | 🟢 | 🟡 [^8] | | |
| 22 | +| Kotlin | [kotlinx.serialization.json][kotlinx] | 🟡 [^9] | 🟡 [^10] | | |
| 23 | +| PHP | [otar/jsonc][otar] | 🟢 | 🟢 | | |
| 24 | +| Python | [n-takumasa/json-with-comments][n-takumasa] | 🟢 | 🟢 | | |
| 25 | +| Rust | [dprint/jsonc-parser][dprint] | 🟢 | 🟢 | | |
| 26 | +| Swift | [steelbrain/JSONCKit][steelbrain] | 🟢 | 🟢 | | |
| 27 | + |
| 28 | +Legend: |
| 29 | + |
| 30 | +🟢: Default support <br> |
| 31 | +🟡: Optional support <br> |
| 32 | +🔴: Unsupported <br> |
| 33 | + |
| 34 | +[otar]: https://github.com/otar/jsonc |
| 35 | +[steelbrain]: https://github.com/steelbrain/JSONCKit |
| 36 | +[hujson]: https://github.com/tailscale/hujson |
| 37 | +[rapidjson]: https://github.com/Tencent/rapidjson |
| 38 | +[nlohmann]: https://github.com/nlohmann/json |
| 39 | +[glaze]: https://github.com/stephenberry/glaze |
| 40 | +[tidwall]: https://github.com/tidwall/jsonc |
| 41 | +[Jackson]: https://github.com/FasterXML/jackson-core |
| 42 | +[massivefermion]: https://github.com/massivefermion/jsonc |
| 43 | +[msft]: https://github.com/microsoft/node-jsonc-parser |
| 44 | +[kotlinx]: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/ |
| 45 | +[n-takumasa]: https://github.com/n-takumasa/json-with-comments |
| 46 | +[dprint]: https://github.com/dprint/jsonc-parser |
| 47 | + |
| 48 | +<hr> |
| 49 | + |
| 50 | +[^1]: Use `ignore_comments` |
| 51 | + |
| 52 | +[^2]: Use `ignore_trailing_commas` |
| 53 | + |
| 54 | +[^3]: Use `kParseCommentsFlag` |
| 55 | + |
| 56 | +[^4]: Use `kParseTrailingCommasFlag` |
| 57 | + |
| 58 | +[^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). |
| 59 | + |
| 60 | +[^6]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)` |
| 61 | + |
| 62 | +[^7]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_TRAILING_COMMA)` |
| 63 | + |
| 64 | +[^8]: Use `allowTrailingComma: true` |
| 65 | + |
| 66 | +[^9]: Use `allowComments`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-comments.html). |
| 67 | + |
| 68 | +[^10]: Use `allowTrailingComma`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-trailing-comma.html). |
0 commit comments