title: JSON SCHEMA conditional: how can I require the key name in some of the list?
body: <p>The JSON schema I want to implement can constrain the attributes under name into a list, as fellow code, I want the name should be input, and the name object the name of people should be some of [&quot;TOM&quot;, &quot;JACK&quot;,&quot;LILY&quot;,&quot;BRUCE&quot;].</p>
  <pre><code>{
    &quot;NAME&quot;:{
        &quot;TOM&quot;: &quot;male&quot;,
        &quot;JACK&quot;: &quot;male&quot;
    }
  } #This object meets the requirements
  {
    &quot;NAME&quot;:{
        &quot;TOM&quot;: &quot;male&quot;,
        &quot;LILY&quot;: &quot;female&quot;
        &quot;BRUCE&quot;: &quot;male&quot;
    }
  }  #This object meets the requirements
  {
    &quot;NAME&quot;:{
        &quot;JERRY&quot;: &quot;male&quot;,
        &quot;LILY&quot;: &quot;female&quot;
        &quot;BRUCE&quot;: &quot;male&quot;
    }
  }  #This object not meets the requirements beacuse JERRY not in the list.
  
  </code></pre>
  <pre><code>{
    &quot;type&quot;: &quot;object&quot;,
    &quot;required&quot;: [&quot;NAME&quot;],
    &quot;properties&quot;: {
      &quot;NAME&quot;: {
        &quot;type&quot;: &quot;object&quot;,
        &quot;required&quot;: [],
        &quot;properties&quot;: {
          &quot;TOM&quot;: {
            &quot;type&quot;: &quot;string&quot;
          },
          &quot;JACK&quot;: {
            &quot;type&quot;: &quot;string&quot;
          },
          &quot;LILY&quot;: {
            &quot;type&quot;: &quot;string&quot;
          },
          &quot;BRUCE&quot;: {
            &quot;type&quot;: &quot;string&quot;
          }
        }
      }
    }
  }
  </code></pre>