title: How to generate JSON schema of object type with dynamic key names?
body: <p>Say I have following json:</p>
  
  <pre><code>{
      "empName": "rameshp",
      "designation": "SE1",
      "skills": [
          {
              "id": 2,
              "rating": 4,
              "skillName": "Node.js 7",
              "skillCategory": "Programming"
          }
      ]
  }
  </code></pre>
  
  <p>Now there could be multiple objects like above, so I want to reference above schema which can be generated from <a href="https://www.jsonschema.net" rel="nofollow noreferrer">https://www.jsonschema.net</a>, but I want to have the empName as object keys and above as value, so it will be an object with multiple unique keys (empName) and the value will be referencing above schema. Consider below example, when the POJO is serialized to JSON by <code>Jackson</code>, it should be like below:</p>
  
  <pre><code>{
      "rameshp": {
          "empName": "rameshp",
          "designation": "SE1",
          "skills": [
              {
                  "id": 2,
                  "rating": 4,
                  "skillName": "Node.js 7",
                  "skillCategory": "Programming"
              }
          ]
      },
      "john": {
          "empName": "john",
          "designation": "SE2",
          "skills": [
              {
                  "id": 2,
                  "rating": 4,
                  "skillName": "Node.js 7",
                  "skillCategory": "Programming"
              }
          ]
      }
  }
  </code></pre>
  
  <p>What should be the overall schema for this scenario (the JSON schema)?  Ultimately, jackson will be used to generate the POJO for this schema and used in the REST APIs that I have created.</p>
  
  <p><strong>EDIT: (trying to clarify)</strong></p>
  
  <p>Imagine a <code>List&lt;Map&lt;k, v&gt;&gt;</code> as my data. I want to have json schema for this whose output json will have the keys as the object names, like above json example.</p>
  
  <p>Solution: Mushif's comment to this question is the answer. For the value part, jsonschema can be used. <code>Map&lt;String, EmployeeDTO&gt;</code></p>