title: Swagger: How to have a property reference a model in OpenAPI 2.0 (i.e. nest the models)?
body: <p>I'm having a hard time trying to figure out how I can nest models in OpenAPI 2.0.</p>
  
  <p>Currently I have:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>SomeModel:
   properties:
     prop1:
       type: string
     prop2:
       type: integer
     prop3:
       type:
         $ref: OtherModel
  
  OtherModel:
    properties:
      otherProp:
        type: string   
  </code></pre>
  
  <p>I have tried many other ways:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>prop3:
    $ref: OtherModel
  # or
  prop3:
    schema:
      $ref: OtherModel
  # or
  prop3:
    type:
      schema:
        $ref: OtherModel
  </code></pre>
  
  <p>None of the above seem to work.</p>
  
  <p>However, with arrays works just fine: </p>
  
  <pre class="lang-yaml prettyprint-override"><code>prop3:
    type: array
    items:
      $ref: OtherModel
  </code></pre>