Our great sponsors
-
msgpack-tools
Command-line tools for converting between MessagePack and JSON / msgpack.org[UNIX Shell]
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
awesome-json-next
A Collection of What's Next for Awesome JSON (JavaScript Object Notation) for Structured (Meta) Data in Text - JSON5, HJSON, HanSON, TJSON, SON, CSON, USON, JSONX/JSON11 & Many More
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I wholeheartedly agree with this idea. In case anyone wants a fast C++ parser for this, RapidJSON [1] has optional support for comments and trailing commas; I actually added trailing comma support to it.
I did this to support hand-writing game data in JSON (e.g. monster stats, campaign dialog scripts) and then converting it to MessagePack at build time [2]. This gives you very high simplicity (e.g. no schemas) and excellent performance.
Been there, done that: https://github.com/nanoscopic/ujsonin
"JSON" parser in both C, Perl, and Golang. All three support "JSON" with or without commas as you desire and comments.
FYI: I collect JSON variants with extension at the Awesome JSON - What's Next? page [1].
I've used ASN.1 at work quite a bit, and the reason you won't see it much are pretty much:
- HORRIBLE schema format.
- Very few FOSS libraries, most of which are terrible. I used Lev Walkins asn1c[0], which I patched slightly and coupled with some semi-generic code to emit JSON (for debugging purposes).
Looks pretty similar to rome json (https://rome.tools/#rome-json)
There are protobuf libraries without code generation, for instance: https://github.com/cloudwu/pbc
I found code generation to be useful in Ruby with protobuf. This:
https://github.com/lloeki/ruby-skyjam/blob/master/defs/skyja...
gives that:
https://github.com/lloeki/ruby-skyjam/blob/master/lib/skyjam...
I would certainly enjoy having a DSL to write descriptive code to validate using JSON schema, but it would be even better if the Ruby definitions could be generated and persisted in Ruby files using that DSL.
Also, storing things in basic hash/array types works, but having dedicated types is useful, so that one can ensure not shoving one kind of hash in place of another unrelated kind of hash.
As for types themselves in general, there's RBS and Sorbet. One could have type definition generation as well for even deeper static and runtime checks.