title: How to convert JsonSchema Path to equivalent jsonPath within a document adhering to that schema?
body: <p>What are the possible ways to convert a JSON path written for JsonSchema to another jsonPath to refer to the same node in the generated document using the same schema?</p>
  <p>Consider the following document:</p>
  <pre><code>{
    myObject: {
      myKey: &quot;myValue&quot;
     }
  }
  </code></pre>
  <p>Which has the following schema:</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;myObject&quot;: {
        &quot;type&quot;: &quot;object&quot;,
        &quot;properties&quot;: {
          &quot;myKey&quot;: {
            &quot;type&quot;: &quot;string&quot;
          }
        },
        &quot;required&quot;: [
          &quot;myKey&quot;
        ]
      }
    },
    &quot;required&quot;: [
      &quot;myObject&quot;
    ]
  }
  </code></pre>
  <p>Within the document, the path expression for myKey would be:</p>
  <pre><code>$.myObject.myKey
  </code></pre>
  <p>But within the schema, the path expression for myKey would be:</p>
  <pre><code>$.properties.myObject.properties.myKey
  </code></pre>
  <p>If I have a schema but want to generate a path expression for working with a document, how do we approach this problem?</p>
  <p>At first glance, it might appear a simple string replacement would suffice.  But once I have a property named &quot;properties&quot; or an array named &quot;items&quot;, it starts to become interesting.</p>