Hi All,<div><br></div><div>Can anyone recommend a library for parsing/validating/serialising objects to and from JSON data structures? I'm envisioning something a bit like an ORM, although obviously without the 'R'...</div>
<div><br></div><div>The following is a bit inconsistent, but should illustrate the idea:</div><div><br></div><div>python:</div><div>class MyObject(JSONObject):</div><div> name = StringField()</div><div> roles = ListField(StringField(), min=0, max=10)</div>
<div> pet = ObjectField({'name': StringField(),</div><div> 'type': PetTypeField()})</div><div><br></div><div>json:</div><div>{</div><div> 'name': 'Mark Smith',</div><div> 'roles': ['user', 'developer'],</div>
<div> pet = {'name': 'Fido', 'type': 'dog'}</div><div>}</div><div><br></div><div>To be honest, the validation is more important than the mapping at this stage.</div><div><br></div><div>
--Mark</div>