title: Reference object JSON schema for entity in array JSON schema
body: <p>I am using Anypoint Studio 7.2.3 and Mule runtime 4.1 to write my RAML.</p>
  
  <p>I have a JSON schema for an order object and I also need a JSON schema for a list of order objects.  I thought I could reference the order object in the JSON schema for the list of orders to save maintaining the same fields in 2 schemas but I am seeing an error because $schema appears twice and is showing the error when I add a JSON example of an order list in the RAML.</p>
  
  <p>Is it possible to have a separate order object JSON schema that can be referenced by an order list JSON schema?</p>
  
  <p><strong>Order Object JSON Schema (cut down version)</strong></p>
  
  <pre><code>{
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema",
      "properties": {
          "orderId": {
              "type": "string",
              "maxLength": 255            
          },
          "comments": {
              "type": "string",
              "maxLength": 255            
          }                                       
      },
      "required": [
          "orderId"
      ]
  }
  </code></pre>
  
  <p><strong>Order List JSON Schema</strong></p>
  
  <pre><code>{
      "type": "array",
      "$schema": "http://json-schema.org/draft-04/schema",
      "properties": {
          "$ref": "#Order"
      }
  }
  </code></pre>
  
  <p>The below JSON schema works for order list but means I will need to maintain the fields in 2 separate schemas so any change to e.g. orderId will mean I will need to change it in both the order object schema and the order list schema.</p>
  
  <pre><code>{
      "type": "array",
      "$schema": "http://json-schema.org/draft-04/schema",
      "properties": {
          "orderId": {
              "type": "string",
              "maxLength": 255            
          },
          "comments": {
              "type": "string",
              "maxLength": 255            
          }                                       
      },
      "required": [
          "orderId"
      ]
  }
  </code></pre>
  
  <p>Thanks for any help. </p>