title: How to extend a schema in JSON schema?
body: <p>I'm using JSON schema for data modelling. I define a base <code>Document</code> schema, that I later use to define model schemas (e.g. <code>Product</code>, <code>Category</code>, <code>User</code>, etc.). </p>
  
  <p>I'm doing this because I want all models to inherit certain structure/rules. For example every model instance should have certain common properties (such as, <code>id</code>, <code>createdAt</code>, <code>updatedAt</code>). In OOP terminology: <code>Product extends Document</code> and therefore it inherits its instance properties. In schemas terminology (I think) <code>Document</code> is a meta-schema for creating model schemas.</p>
  
  <p>I've defined the Document schema as follows:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "id": "http://example.com/schemas/document.json#",
    "title": "Document",
    "type": "object",
    "additionalProperties": false,
    "required": ["type", "name", "fields"],
    "properties": {
      "type": {
        "constant": "document"
      },
      "name": {
        "type": "string"
      },
      "title": {
        "type": "string"
      },
      "description": {
        "type": "string"
      },
      "readOnly": {
        "type": "boolean"
      },
      "properties": {
        // common properties 
        // model-specific properties
      }
    }
  }
  </code></pre>
  
  <ol>
  <li>How do I specify that the Document meta-schema "extends" the base JSON schema (draft-07), so that I don't have to define all the properties of the draft (<code>$schema</code>, <code>id</code>, etc.)?</li>
  <li>How do I specify that the <code>properties</code> of each model schema contains some common properties (<code>id</code>, <code>createdAt</code>, ...), without having to define them in each model schema definition? </li>
  </ol>