I love JSON!
Jun. 30th, 2011 12:19 pmDesigning a config file structure; first I started with something like
But then, well, I convert them to a map; and I was thinking about validating them, to make sure ids don't repeat, they are present, etc.
Using jackson.
Then kaboom, it's javascript, not xml!!!
So the result is:
Exactly reflects my data, no xml fluff. Very similar to what I would write if I used Scala and wrote my own parser.
Go ahead, critique, tell me I need a dtd.
"descriptors": [{"id": "first_one", "url": "http://google.com:8080"}, {"id": "second_one", "url": "facebook.com"}]
But then, well, I convert them to a map; and I was thinking about validating them, to make sure ids don't repeat, they are present, etc.
Using jackson.
Then kaboom, it's javascript, not xml!!!
So the result is:
"descriptors": {"first_one": "http://google.com:8080", "second_one": "facebook.com"}
Exactly reflects my data, no xml fluff. Very similar to what I would write if I used Scala and wrote my own parser.
Go ahead, critique, tell me I need a dtd.