title: JSON Schema - require all properties
body: <h1>The <code>required</code> field in JSON Schema</h1>
  
  <p>JSON Schema features the <code>properties</code>, <code>required</code> and <code>additionalProperties</code> fields. For example,</p>
  
  <pre><code>{
      "type": "object",
      "properties": {
          "elephant": {"type": "string"},
          "giraffe": {"type": "string"},
          "polarBear": {"type": "string"}
      },
      "required": [
          "elephant",
          "giraffe",
          "polarBear"
      ],
      "additionalProperties": false
  }
  </code></pre>
  
  <p>Will validate JSON objects like:</p>
  
  <pre><code>{
      "elephant": "Johnny",
      "giraffe": "Jimmy",
      "polarBear": "George"
  }
  </code></pre>
  
  <p>But will fail if the list of properties is not <em>exactly</em> <code>elephant, giraffe, polarBear</code>.</p>
  
  <h1>The problem</h1>
  
  <p>I often copy-paste the list of <code>properties</code> to the list of <code>required</code>, and suffer from annoying bugs when the lists don't match due to typos and other silly errors.</p>
  
  <p><strong>Is there a shorter way to denote that all properties are required, without explicitly naming them?</strong></p>