title: JSON schema enum vs pattern for single value
body: <p>I have an sample json:</p>
  
  <pre><code>{
      "type": "persons",
      "id": 2,
      "attributes": {
          "first": "something",
          "second": "something else"
      }
  }
  </code></pre>
  
  <p>And I have to make a schema for it (using <a href="http://jsonapi.org/format/%20%22JSON%20API%20specs" rel="noreferrer">JSON API specs</a> and <a href="http://json-schema.org/latest/json-schema-validation.html" rel="noreferrer">JSON schema docs</a>):</p>
  
  <pre><code>{
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "properties": {
          "type": {
              "type": "string",
              "pattern": "^persons$"
          },
          "id": {
              "type": "integer"
          },
          "attributes": {
              "type": "object",
              "properties": {...}
          }
      },
      "required": ["type", "id", "attributes"]
  }
  </code></pre>
  
  <p>And the question is: if the only acceptable value for "type" is "persons", should I use in schema pattern (like above) or enum like</p>
  
  <pre><code>"enum": ["persons"]
  </code></pre>
  
  <p>I couldn't get any clear answer from documentation, although in examples in specs enums are used for single values. So what's your opinion?</p>