title: Using multiple Swagger definitions at root of object
body: <p>I am trying to create a Response Object that looks like this:</p>
  
  <p>(simplified for example)</p>
  
  <pre><code>{
  "data1": "1234"
  "data2" : "445"
  }
  </code></pre>
  
  <p>I have 2 definitions: </p>
  
  <pre><code> obj1: 
    type: object 
    properties: 
     data1:
      type: string
  
   obj2:
    type: object 
    properties: 
     data2:
      type: string
  </code></pre>
  
  <p>Then a 3rd definition that looks like this:</p>
  
  <pre><code>  Main:
      type: object
      allOf:
        - $ref: "#/definitions/ob1"
        - $ref: "#/definitions/obj2"
  </code></pre>
  
  <p>I'm not sure if this is the correct way to merge both Obj1 and Obj 2 at the base of the Main object </p>
  
  <p>The Swagger UI show the following </p>
  
  <pre><code>Responses
  
  Code    Description Schema
  200  Success ⇄  
  Main {
  all of:
  obj1 { }
  obj2 { }
  }
  </code></pre>
  
  <p>What I'm unclear about is if it will set these objects at the root or if its stating 2 objects will be in the response???</p>
  
  <p>I'm assuming its correct, hoping someone can confirm. </p>