I wanted a tool that, given a simple text format, can parse it and output JSON that can be used elsewhere. The input would be of a syntax that is easy and quick to write by hand, but that JSON can represent natively in full.
This comes from a frustration from attempting to write JSON by hand; it's error prone and time-consuming especially when dealing with anything even slightly complex, not to mention the lack of a standard spacing / newline conventions.
After some searching I found ObjGen. This seems very close to what I want, however it isn't perfect (it can't handle certain constructs), and before I go and create my own open source version, I wanted to know if there's anything similar out there?
Edit - Further information
The construct I was referring to was a list of strings like this:
{
"list_of_strings": [
"hello",
"hello, again",
"goodbye"
]
}
It didn't seem possible to express this in the ObjGen input format, because string arrays are always split on ,
even if escaped (in fact it doesn't support escaping control characters as far as I can tell, since \
is simply output as "\"
). However I found that it can be achieved by using the ASCII code such as "hello , again"
.