title: json schema to validate property value with its dynamic key
body: <p>data:</p>
  <pre><code>{
    &quot;dynamic_key_1&quot;: {
      &quot;key1&quot;: &quot;value1&quot;
      &quot;id&quot;: &quot;dynamic_key_1&quot;
    },
    &quot;dynamic_key_2&quot;: {
      &quot;key1&quot;: &quot;value2&quot;
      &quot;id&quot;: &quot;some_random&quot;
    }
  }
  </code></pre>
  <p>schema:</p>
  <pre><code>{
      &quot;patternProperties&quot;: {
        &quot;^[^{}\&quot;/\\\\]+$&quot;: {
          &quot;type&quot;: &quot;object&quot;,
          &quot;required&quot;: [
            &quot;id&quot;
          ],
          &quot;properties&quot;: {
            &quot;id&quot;: {
              &quot;type&quot;: &quot;string&quot;
              // ... validate with key
            }
          }
       }
    }
  }
  </code></pre>
  <p>How to validate the <code>id</code> value to equal it's <code>key</code> using json schema.</p>
  <p>In above case the <code>dynamic_key_1</code> would pass and <code>dynamic_key_2</code> would fail the test.</p>