title: How to validate a request with nested json objects in django rest framework using serializers?
body: <p>I have following request.</p>
  <pre><code>{
    &quot;customer_details&quot;: {
      &quot;id&quot;: 6, // either id or below fields should be present to create new customer in database
      &quot;name&quot;: &quot;Name&quot;,
      &quot;email&quot;: &quot;email@example.com&quot;,
      &quot;mobile&quot;: &quot;1234567890&quot;,
      &quot;company&quot;: &quot;Company Name&quot; // not mandatoy
    },
    &quot;delivery_address&quot;: {
      &quot;id&quot;: 7, // either id or below fields should be present to create new address in database
      &quot;title&quot;: &quot;Delivery Address Title 1&quot;,
      &quot;street&quot;: &quot;Delivery Address Street 1&quot;,
      &quot;suite&quot;: &quot;Delivery Address suite 1&quot;, // not mandatoy
      &quot;city&quot;: &quot;Delivery Address city 1&quot;,
      &quot;zipcode&quot;: &quot;zipcode1&quot;,
      &quot;county&quot;: &quot;Dade&quot;,
      &quot;state&quot;: &quot;Delivery Address state 1&quot;
    },
    &quot;billing_address&quot;: {
      &quot;id&quot;: 8, // either id or below fields should be present to create new address in database
      &quot;title&quot;: &quot;Billing Address Title 1&quot;,
      &quot;street&quot;: &quot;Billing Address Street 1&quot;,
      &quot;suite&quot;: &quot;Billing Address suite 1&quot;, // not mandatoy
      &quot;city&quot;: &quot;Billing Address city 1&quot;,
      &quot;zipcode&quot;: &quot;zipcode2&quot;,
      &quot;county&quot;: &quot;Billing Address county 1&quot;,
      &quot;state&quot;: &quot;Billing Address state 1&quot;,
      &quot;payment_method&quot;: &quot;Cheque&quot;
    }
  }
  </code></pre>
  <p>How can I validate the above request using django serializers?</p>