title: nested "oneOf" issue in json schema draft 4 using tv4.js
body: <p>I'm using <a href="https://github.com/geraintluff/tv4" rel="nofollow">tv4.js</a> to validate some json against a schema (which has nested oneOf properties) but it returns errors when I am using valid data. Here is the result object I get back from the tv4.js validateMultiple method: </p>
  
  <pre><code>{"valid":false,"errors":[{"code":11,"message":"Data does not match any schemas from \"oneOf\"","schemaKey":null,"dataPath":"/shape","subErrors":[{"code":302,"message":"Missing required property: boxname","schemaKey":null,"dataPath":"/shape","subErrors":null},{"code":1,"message":"No enum match for: \"circle\"","schemaKey":null,"dataPath":"/shape/thetype","subErrors":null},{"code":12,"message":"Data is valid against more than one schema from \"oneOf\": indices 0 and 1","schemaKey":null,"dataPath":"/shape","subErrors":null}]}],"missing":[]}
  </code></pre>
  
  <p>Here is my test schema:</p>
  
  <pre><code>{
      "type": "object",
      "properties": {
          "shape": {
              "oneOf": [
                  { "$ref":"#/definitions/squareSchema" },
                  { "$ref":"#/definitions/circleSchema" }
              ]
          }
      },
      "definitions": {
          "squareSchema": {
              "type": "object",
              "properties": {
                  "thetype": {
                      "type": "string",
                      "enum": ["square"]
                  },
                  "colour":{},
                  "shade":{},
                  "boxname": {
                      "type":"string"
                  }
              },
              "oneOf":[
                  { "$ref":"#/definitions/colourSchema" },
                  { "$ref":"#/definitions/shadeSchema" }
              ],
              "required": ["thetype", "boxname"],
              "additionalProperties":false
          },
          "circleSchema": {
              "type": "object",
              "properties": {
                  "thetype": {
                      "type": "string",
                      "enum":["circle"]
                  },
                  "colour":{},
                  "shade":{}
              },
              "oneOf":[
                  { "$ref":"#/definitions/colourSchema" },
                  { "$ref":"#/definitions/shadeSchema" }
              ],
              "additionalProperties":false
          },
          "colourSchema":{
              "type":"object",
              "properties":{
                  "colour":{
                      "type":"string"
                  },
                  "shade":{
                      "type":"null"
                  }
              }
          },
          "shadeSchema":{
              "type":"object",
              "properties":{
                  "shade":{
                      "type":"string"
                  },
                  "colour":{
                      "type":"null"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>And here is the data I would expect to validate:</p>
  
  <pre><code>{
      "shape": {
          "thetype": "circle",
          "shade":"red"
      }
  }
  </code></pre>
  
  <p>I seem to only encounter this issue when using nested "oneOf".
  Is this an issue with my schema? Or a bug with tv4.js?
  Are there any alternative validators which will do this validation within a web browser?</p>
  
  <p>Any help would be appreciated.</p>