Also I think that a "generic" JSON is not a good idea, since a single JSON value can be a multi million elements list or alike. The best thing to do is to create a JSON that is also specifically conceived to be both valid but to also have a single element per line, so that can be parsed much faster and with minimal state without a real JSON parser if needed.