title: How to validate a dynamic JSON using a serializer using Django Rest Framework?
body: <p>I have an API that accepts JSON. The JSON data has a key called <code>type</code> which should be a choice field and have a value among 5 specified types. Say A,B,C,D &amp; E.</p>
  
  <p>There are different fields that JSON can have depending upon whether the value is A,B,C, D or E. How do I go about validating the other fields that may or may not be there?</p>