title: JSON schema reference another element in the document
body: <p>Is there a way to express reference to another element in the same JSON document using JSON schema? The title might be a bit confusing, but i'm not looking for the <code>"$ref"</code> attribute, which references another <em>type</em>, but I'm curious, if there is a way, to reference another element in the document using a specified field. I know this is possible to enforce using xsd for xml documents, not sure about JSON.</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>{
    "people": [
      { "id": "1", "name": "A" },
      { "id": "2", "name": "B" },
      { "id": "3", "name": "C" }
    ],
    "chosenOne": "1" // I want the schema to enforce a person ID here
  }
  </code></pre>
  
  <p>I have been looking at the schema definition of v4: <a href="http://json-schema.org/draft-04/schema" rel="noreferrer">http://json-schema.org/draft-04/schema</a> but didn't find anything, that looks like what I'm trying to do. Did I just miss it?</p>