title: Define JSONschem using oneOf and $ref for Swagger contract
body: <p>I am writing a swagger contract but my data models are defined with JSONSchemas.</p>
  
  <p>After create my models, I am testing them in swagger UI. Now I am with problems to use the 'oneOf' for my references. as follow...</p>
  
  <pre><code>...
   "socio":{
              "type":{
                  "oneOf":[
                      {
                          "properties":{
                                 "pessoaFisica":{
                                  //"pessoaFisica": "object",
                                  "$ref":"http://soa-mds/XXXXXX/apps/SOA/JSONSchemas/Corporativo/pessoaFisica.json"
                              },
                              "pessoaJuridica":{   
                                    //"pessoaJuridica": "object",
                                  "$ref":"http://soa-mds/dataprev.gov.br/apps/SOA/JSONSchemas/Corporativo/pessoaJuridica.json"
                              },
                              "estrangeiro":{
                                  //"estrangeiro": "object",
                                  "$ref":"http://soa-mds/XXXXXX/apps/SOA/JSONSchemas/Corporativo/estrangeiro.json"
                              }
                          }
                      }         
                  ]   
              }
          }         
      },
  ....
  </code></pre>
  
  <p>After a research I don´t find the correct way to use the oneOF with $ref.</p>
  
  <p>Can anyone Help me?</p>
  
  <p>Thanks,
  MMR
  <a href="https://i.stack.imgur.com/v2ofK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v2ofK.jpg" alt="Swagger UI result A"></a></p>