title: Pydantic: validating a nested model
body: <p>I have a nested model in Pydantic. I have a <code>root_validator</code> function in the outer model. I was under the impression that if the outer root validator is called, then the inner model is valid. But apparently not. In the following MWE, I give the wrong field name to the inner model, but the outer validator is failing:</p>
  <pre class="lang-py prettyprint-override"><code>from typing import List
  from pydantic import BaseModel
  from pydantic.class_validators import root_validator
  
  class CarList(BaseModel):
      cars: List[str]
      colors: List[str]
  
  class CarDealership(BaseModel):
      name: str
      cars: CarList
  
      @root_validator()
      def check_length(cls, v):
          cars_list = v.get(&quot;cars&quot;)
  
          if len(cars_list.cars) != len(cars_list.colors):
              raise ValueError(&quot;wrong length&quot;)
          
          return v
  
  
  car_deal = {
      &quot;cars&quot;: {
          &quot;cars1&quot;: [&quot;toyota&quot;, &quot;tesla&quot;], 
          &quot;colors&quot;: [&quot;white&quot;, &quot;red&quot;]
      }
  }
  
  CarDealership.parse_obj(car_deal)
  </code></pre>
  <p>The error I get is:</p>
  <pre><code>  File &quot;test.py&quot;, line 17, in check_length
      if len(cars_list.cars) != len(cars_list.colors):
  AttributeError: 'NoneType' object has no attribute 'cars'
  </code></pre>
  <p>I was expecting something like:</p>
  <pre><code>pydantic.error_wrappers.ValidationError: 1 validation error for CarList
  cars
    field required (type=value_error.missing)
  </code></pre>
  <p>How can I make sure the inner model is validated first?</p>