title: Suggestions for python REST API json serialization
body: <p>I am used to build rest apis with PHP and I make heavy usage of the JMC serializer. It basically lets me write annotations to class properties that define the name and type of variables, including nested classes and arrays. This lets me completely abstract away the json format and just work with classes which transparently serialize and deserialize to JSON. In combination with symfony validator, this approach is very simple to work with, but also very powerful.</p>
  
  <p>Now to my question, I recently started adopting python for some projects and I would like to reimplement an API in python. I have searched the internet for a suitable equivalent to JMS serializer, but I didn't find one that has the same or simillar capabilities.</p>
  
  <p>Would anyone be so kind to point me in the right direction? (either good library or recommend a different approach with equal or better efficiency)</p>
  
  <p>What I need:</p>
  
  <ul>
  <li>ability to serialize and deserialize object into JSON</li>
  <li>define how object is serialized - names of JSON attributes and their data types</li>
  <li>define a complex object graphs (ability to define a class as property type, which would than be mapped by its own definition)</li>
  <li>ability to map dicts or arrays and types they contain</li>
  </ul>
  
  <p>Thanks in advance</p>