title: Loopback validation on Properties whose types are other Models (version 2.xx)
body: <p>NOTE: This is kind of a duplicate of <a href="https://stackoverflow.com/questions/24161921/loopback-validation-on-properties-whos-types-are-other-models">Loopback validation on Properties who&#39;s types are other Models</a> but I am re-asking because a lot of changes were made in Loopback 2</p>
  
  <p>I have a Model (Vehicle) that has properties that are object with some data that needs to be validated.</p>
  
  <p>Here is a sample vehicle</p>
  
  <pre><code>{
  
      details : {
          year : 2007,
          make: 3333,
          ....
      },
      options : {
          hasAirbags: true,
          powerWindows : false,
          ....
      }
      ....
  }
  </code></pre>
  
  <p>I have defined my models as such</p>
  
  <pre><code>"vehicleDetails": {
      "properties": {
          "year": {
              "type": "string",
              "required": true
          }
      },
      "public": true,
      "dataSource": "db",
      "plural": "addresses"
  },  
  "Vehicle": {
      "properties": {
          "options": {
              "type": "vehicleOptions"
          },
          "details":{
              "type": "vehicleDetails"
          }
      },
      "public": true,
      "dataSource": "db",
      "plural": "locations"
  }
  </code></pre>
  
  <p>However, when I create a vehicle. it doesn't check to see if the details object I pass is valid. Relationship between vehicle and vehicleDetails is one-to-one, so I don't want to separate them with relationships.</p>