title: How do I define my own JSON Schema keyword and vocabulary?
body: <p>I would like to define a JSON schema vocabulary to extend any regular JSON schema with storage related metadata.
  As an example I would like to define a <code>pk</code> keyword which marks an arbitrary JSON property as a primary key.</p>
  <p>My meta-schema looks like this:</p>
  <pre><code>{
    &quot;$schema&quot;: &quot;http://json-schema.org/draft/2019-09/schema#&quot;,
    &quot;$id&quot;: &quot;https://myschema/meta/storage-schema&quot;,
    &quot;$vocabulary&quot;: {
      &quot;https://json-schema.org/draft/2019-09/vocab/core&quot;: true,
      &quot;https://json-schema.org/draft/2019-09/vocab/applicator&quot;: true,
      &quot;https://json-schema.org/draft/2019-09/vocab/validation&quot;: true,
      &quot;https://json-schema.org/draft/2019-09/vocab/meta-data&quot;: true,
      &quot;https://json-schema.org/draft/2019-09/vocab/format&quot;: false,
      &quot;https://json-schema.org/draft/2019-09/vocab/content&quot;: true,
      &quot;https://myschema/vocab/storage-schema&quot;: false
    },
    &quot;$recursiveAnchor&quot;: true,
  
    &quot;title&quot;: &quot;JSON Storage-Schema&quot;,
    &quot;allOf&quot;: [
      {&quot;$ref&quot;: &quot;https://json-schema.org/draft/2019-09/schema&quot;},
      {
        &quot;$recursiveAnchor&quot;: true,
  
        &quot;title&quot;: &quot;storage vocabulary meta-schema&quot;,
  
        &quot;type&quot;: [&quot;object&quot;, &quot;boolean&quot;],
        &quot;properties&quot;: {
          &quot;pk&quot;: {
            &quot;description&quot;: &quot;Marks a property as primary key&quot;,
            &quot;type&quot;: &quot;boolean&quot;,
            &quot;default&quot;: false
          }
        }
      }
    ]
  }
  </code></pre>
  <p>And a corresponding JSON instance might be:</p>
  <pre><code>{
    &quot;$id&quot;: &quot;https://myschema/invoice.schema.json&quot;,
    &quot;$schema&quot;: &quot;https://myschema/meta/storage-schema&quot;,
    &quot;type&quot;: &quot;object&quot;,
    &quot;properties&quot;: {
      &quot;invoiceNumber&quot;: {
        &quot;pk&quot;: true,
        &quot;type&quot;: &quot;string&quot;
      },
      &quot;invoiceIssueDate&quot;: {
        &quot;type&quot;: &quot;string&quot;
      }
    }
  }
  </code></pre>
  <p>However, I am not sure if I am on the right track. For example WebStorm's IntelliSense only offers the <code>pk</code> keyword as a top level keyword and not as a keyword for properties:</p>
  <pre><code>{
    &quot;$id&quot;: &quot;https://myschema/invoice.schema.json&quot;,
    &quot;$schema&quot;: &quot;https://myschema/meta/storage-schema&quot;,
    &quot;$comment&quot;: &quot;Webstorm IntelliSense works and pk documentation is displayed&quot;,
    &quot;pk&quot;: false,
    &quot;type&quot;: &quot;object&quot;,
    &quot;properties&quot;: {
      &quot;invoiceNumber&quot;: {
        &quot;$comment&quot;: &quot;No webstorm IntelliSense and no documentation displayed&quot;,
        &quot;pk&quot;: true,
        &quot;type&quot;: &quot;string&quot;
      },
      &quot;invoiceIssueDate&quot;: {
        &quot;type&quot;: &quot;string&quot;
      }
    }
  }
  </code></pre>
  <p>Does anyone have experience with meta-schemas and custom keywords and can confirm if I am doing it right?</p>