title: Swagger multiple bodies with different model
body: <p>Hi All I am new to swagger and stuck at one point and need help from experts.
  This is what I need</p>
  
  <p>I want to write a PUT method that accept two different types of bodies one at one time.</p>
  
  <p>I am able to do this by making two process_models and defining my bodies bases on them like this</p>
  
  <pre><code>&gt;  api.process_model('MacBased',
  &gt;     {'id' : 'MacBased',
  &gt;     'required': [ 'physicalMacAddress'],
  &gt;     'properties': {
  &gt;        'physicalMacAddress' : {
  &gt;           'type' : 'string',
  &gt;           'description' : 'Mac address.'
  &gt;       },
  &gt;       'vlan' : {
  &gt;          'type' : 'string',
  &gt;          'description' : 'vlan id '
  &gt;       }
  &gt;     }
     });
  </code></pre>
  
  <p>api.process_model('InterfaceBased',</p>
  
  <blockquote>
  <pre><code>{'id' : 'InterfaceBased',
  'required': [ 'interfaceName', 'hostName'],
  'properties': {
    'interfaceName' : {
      'type' : 'string',
      'description' : 'physical interface name'
     },
    'hostName' : {
      'type' : 'string',
      'description' : 'Name of machine'
     },
     'vlan' : {
       'type' : 'string',
       'description' : 'vlan id '
     }
  }
  </code></pre>
    
    <p>});</p>
  </blockquote>
  
  <p>and then body like this</p>
  
  <pre><code>&gt;  api.process_api('PUT', {
  &gt;     // general group that this api belongs to
  &gt;     'group' : "ABC",
  &gt;     'spec' : {
  &gt;       path : "/config/{name}",
  &gt;       method : "PUT",
  &gt;       notes : "",
  &gt;       produces : ["application/json"],
  &gt;       parameters : [param.path("name", "Name", "string"),
  &gt;                           {
  &gt;                           "name": "body",
  &gt;                           "description": "Mac based",
  &gt;                           "required": false,
  &gt;                           "type": "MacBased",
  &gt;                           "paramType": "body"
  &gt;                           },
  &gt;                           {
  &gt;                           "name": "body",
  &gt;                           "description": "Device based",
  &gt;                           "required": false,
  &gt;                           "type": "InterfaceBased",
  &gt;                           "paramType": "body"
  &gt;                           }]
  </code></pre>
  
  <p>Here everything is working fine and I can see two body text boxes in Swagger.
  Issue is that which ever body I filled swagger tries to validate the JSON for first model that is <strong>MacBased</strong> so first body data went fine and when I try to post data using second body it fails on parsing.</p>
  
  <p>Any idea how to parse the data with the specified model of that body?
  Thanks</p>