title: Allow additional properties in reference schemas, but none else
body: <p>Suppose I have two schema being used to validate a json file.</p>
  <p><strong>testSchema.json</strong></p>
  <pre><code>{
      &quot;$schema&quot;: &quot;http://json-schema.org/draft-07/schema&quot;,
      &quot;type&quot;: &quot;object&quot;,
      &quot;additionalProperties&quot;: false,
      &quot;properties&quot;: {
          &quot;$schema&quot;: { &quot;type&quot;: &quot;string&quot; },
          &quot;sample&quot;: { &quot;type&quot;: &quot;number&quot; }
      },
      &quot;anyOf&quot;: [
          { &quot;$ref&quot;: &quot;./testSchema2.json&quot; },
          {}
      ]
  }
  </code></pre>
  <p><strong>testSchema2.json</strong></p>
  <pre><code>{
      &quot;$schema&quot;: &quot;http://json-schema.org/draft-04/schema&quot;,
      &quot;type&quot;: &quot;object&quot;,
      &quot;properties&quot;: {
          &quot;test&quot;: { &quot;type&quot;: &quot;string&quot; },
          &quot;test2&quot;: { &quot;type&quot;: &quot;number&quot; }
      }
  }
  </code></pre>
  <p><strong>test.json</strong></p>
  <pre><code>{
      &quot;$schema&quot;: &quot;../testSchema.json&quot;,
      &quot;sample&quot;: 0,
      &quot;test&quot;: &quot;some text&quot; //this line throws error &quot;Property is not allowed&quot;
  }
  </code></pre>
  <p>I'd like for the file to be validated against the included schema's properties and any schema that is referenced's properties. Am I missing something?</p>
  <p>Edit: I want to exclude any objects that are not explicitly defined in any of my included/referenced schema.</p>