title: jsonschema multiple values for string property
body: <p>I have a json schema which describes a fairly complex API querying syntax. A few of the properties are pattern matched but also need to accept other values (i.e. other explicit strings) other than just the pattern. I can't seem to find anywhere in the multitude of json schema sites any examples of this.</p>
  
  <p>An example:</p>
  
  <pre><code>{
      "type": "object",
      "properties": {
          "$gte": {
              "type": "string",
              "pattern": "&lt;some-pattern&gt;"
          }
      }
  }
  </code></pre>
  
  <p>What i'd like to be able to do in the example above  is specify that <code>$gte</code> can be any of a certain set of constrained values. For example, this specific implementation requires that "$gte"'s values be constrained to one of the following:</p>
  
  <ol>
  <li>A specific date format</li>
  <li>A token <code>{token}</code> which gets replaced with a special value on the server-side</li>
  </ol>
  
  <p>I've seen the <code>oneOf</code> property used in this situation but only with the <code>format</code> property so I'm assuming that this is possible, just not sure of the syntax of how to implement it, for instance it could be something like this:</p>
  
  <pre><code>{
      "type": "object",
      "properties": {
          "$gte": {
              "type": "string",
              "oneOf": [
                  {"pattern": "&lt;some-pattern&gt;"},
                  "{token}",
                  "{another_token}"
              ]
          }
      }
  }
  </code></pre>
  
  <p>Any clarity on how to accomplish this would be greatly appreciated as I'm not having much luck with the specification Draft 4 for json schema or in finding any examples.</p>