When writing JSON messages, some C/C++ libraries work by building an in-memory object for the sole purpose of serialising it as JSON. Many libraries comprise multiple header and source files and/or expose a complex API.
minijson_writer is a simple decorator around a std::ostream. It directly writes on the stream without allocating additional memory, and does not throw exceptions unless the stream does.
Despite being a single header file of ~500 lines, minijson_writer is complete and can be easily extended to support custom types.
These details are provided for information only. No information here is legal advice and should not be used as such.