title: JSON Schema - Enum of Objects
body: <p>I'm new to JSON schema, so bear with me. My goal is to have a JSON property that is an object. It's keys relate to each other, meaning multiple keys always have the same values together. This will probably help make it clear, it's my attempt to do this with an enum:</p>
  <pre><code>{
    &quot;$schema&quot;: &quot;https://json-schema.org/draft/2019-09/schema&quot;,
    &quot;title&quot;: &quot;Part&quot;,
    &quot;type&quot;: &quot;object&quot;,
    &quot;properties&quot;: {
      &quot;relationship&quot;: {
        &quot;type&quot;: &quot;object&quot;,
        &quot;enum&quot;: [
          {
            &quot;code&quot;: &quot;1&quot;,
            &quot;value&quot;: &quot;MEMBER&quot;
          },
          {
            &quot;code&quot;: &quot;2&quot;,
            &quot;value&quot;: &quot;SPOUSE&quot;
          },
          {
            &quot;code&quot;: &quot;3&quot;,
            &quot;value&quot;: &quot;CHILD&quot;
          },
          {
            &quot;code&quot;: &quot;4&quot;,
            &quot;value&quot;: &quot;STUDENT&quot;
          },
          {
            &quot;code&quot;: &quot;5&quot;,
            &quot;value&quot;: &quot;DISABILITY_DEPENDENT&quot;
          },
          {
            &quot;code&quot;: &quot;6&quot;,
            &quot;value&quot;: &quot;ADULT_DEPENDENT&quot;
          },
          {
            &quot;code&quot;: &quot;8&quot;,
            &quot;value&quot;: &quot;DOMESTIC_PARTNER&quot;
          }
        ]
      }
    }
  }
  </code></pre>
  <p>So using an enum like this works, even though I can't find it anywhere in the JSON Schema spec. However, the error message sucks. Normally I get the most extremely detailed error messages from schema validation, however in this case I do not.</p>
  <pre><code>$.part.relationship: does not have a value in the enumeration [, , , , , , ]
  </code></pre>
  <p>I'm not sure what I'm doing wrong. I'm using a Java parser for JSON Schema:</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.networknt&lt;/groupId&gt;
      &lt;artifactId&gt;json-schema-validator&lt;/artifactId&gt;
      &lt;version&gt;1.0.53&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>Not sure if the error message is the fault of the parser or something I'm doing bad with the schema. Help would be appreciated.</p>