title: Nested validation with the flask-restful RequestParser
body: <p>Using the <a href="http://flask-restful.readthedocs.org/" rel="noreferrer">flask-restful</a> micro-framework, I am having trouble constructing a <code>RequestParser</code> that will validate nested resources.  Assuming an expected JSON resource format of the form:</p>
  
  <pre><code>{
      'a_list': [
          {
              'obj1': 1,
              'obj2': 2,
              'obj3': 3
          },
          {
              'obj1': 1,
              'obj2': 2,
              'obj3': 3
          }
      ]
  }
  </code></pre>
  
  <p>Each item in <code>a_list</code> corresponds to an object:</p>
  
  <pre><code>class MyObject(object):
      def __init__(self, obj1, obj2, obj3)
          self.obj1 = obj1
          self.obj2 = obj2
          self.obj3 = obj3
  </code></pre>
  
  <p>... and one would then create a RequestParser using a form something like:</p>
  
  <pre><code>from flask.ext.restful import reqparse
  parser = reqparse.RequestParser()
  parser.add_argument('a_list', type=MyObject, action='append')
  </code></pre>
  
  <p>... but how would you validate the nested <code>MyObject</code>s of each dictionary inside <code>a_list</code>?  Or, alternately, is this the wrong approach?</p>
  
  <p>The API this corresponds to treats each <code>MyObject</code> as, essentially, an object literal, and there may be one or more of them passed to the service; therefore, flattening the resource format will not work for this circumstance.</p>