title: Need to Extract only keys present in the JSON schema
body: <pre><code>  {
      "type" : "object",
      "properties" : {
         "header" : {
           "type" : "object",
           "properties" : {
              "outType" : {
                "type" : "string"
              },
              "id" : {
                "type" : "string"
              },
              "application" : {
                "type" : "string"
              },
              "userId" : {
                "type" : "string"
              },
           }
         }
      }
  </code></pre>
  
  <p>In the above snippet i only want the keys. I am iterating a variable through the object properties which is giving me only "type" &amp; "properties". But I want all the keys present in nested objects. Recursion is the only solution to this. But failing in applying the logic to the above snippet.
  How can I identify that the value of a particular key is again an object..??</p>
  
  <p>I am try it with this above function, is that correct?</p>
  
  <pre><code>function traverse(myObj) {
    for (x in myObj) {
      if typeof myObj[x] == 'string'
      then print(x);
      else traverse(myObj[x])
    }
  }
  </code></pre>