Json Codec
abstract class JsonCodec<T>(serializer: KSerializer<T>, val fileName: String, error: (message: String, cause: Throwable) -> IOException)
Reads and writes one JSON file format; each format's codec is an object extending this.
Reading is strict: an unknown key (most often a typo), a missing field, or a value that fails the model's validation is an IOException from error with the reason, never a silent default. A leading byte-order mark, which some Windows editors add, is accepted. Writing is pretty-printed UTF-8 with \n line endings, so the same value always encodes to the same bytes, and a write to a Path goes through AtomicFile.
fileName is the name files of this format go by, for example roto.json; error messages use it too.