title: ajv@7.2.4 - Error: strict mode: unknown keyword: "unevaluatedProperties" -
body: <p>I expect the ajv keyword a <code>unevaluatedProperties</code> to be defined and working in ajv version 7.2.4, however I get the error message in the title.</p>
  <p>Here is the npm version listing:</p>
  <pre><code>$ npm list ajv
  tscapi@0.0.1 /mnt/common/github/tscapi
  ├── ajv@7.2.4 
  └─┬ eslint@7.24.0
    ├─┬ @eslint/eslintrc@0.4.0
    │ └── ajv@6.12.6 
    ├── ajv@6.12.6 
    └─┬ table@6.2.0
      └── ajv@8.1.0 
  </code></pre>
  <p>Here is the code that gives the error:</p>
  <pre><code>import * as ajv from 'ajv';
  
  const schemas = [
    {
      $id: 'schemas.json#/1',
      anyOf: [{$ref: 'schemas.json#/2'}, {$ref: 'schemas.json#/3'}],
    },
    {
      $id: 'schemas.json#/2',
      type: 'object',
      properties: {
        a: {type: 'string'},
      },
      required: ['a'],
      unevaluatedProperties: true,
    },
    {
      $id: 'schemas.json#/3',
      type: 'object',
      properties: {
        b: {type: 'string'},
      },
      required: ['b'],
      unevaluatedProperties: true,
    },
    {
      $id: 'schemas.json#/4',
      type: 'object',
      allOf: [{$ref: 'schemas.json#/2'}, {$ref: 'schemas.json#/3'}],
      unevaluatedProperties: false,
    },
  ];
  
  const validators = new ajv.default({schemas: schemas});
  {
    const validate = validators.getSchema('schemas.json#/1')!;
    validate({a: 'hello'});
    if (validate.errors) throw new Error(validate.errors[0].message);
    console.log('ok 1');
  }
  {
    const validate = validators.getSchema('schemas.json#/4')!;
    validate({a: 'hello', b: 'hello'});
    if (validate.errors) throw new Error(validate.errors[0].message);
    console.log('ok 2');
  }
  </code></pre>
  <p>In the file <code>node_modules/ajv/README.md</code> the following text is found, which shows that <code>unevaluatedProperties</code> should not be unknown in this version of ajv.</p>
  <pre><code>## Using version 7
  
  Ajv version 7 has these new features:
  ...
  - support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./docs/json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./docs/json-schema.md#unevaluateditems), [dynamic recursive references](./docs/guide/combining-schemas.md#extending-recursive-schemas) and other [additional keywords](./docs/json-schema.md#json-schema-draft-2019-09).
  ...
  </code></pre>
  <p>I've also tried changing one line in the code</p>
  <pre><code>const validators = new ajv.default({schemas: schemas});
  </code></pre>
  <p>to</p>
  <pre><code>const opts = {next:true,unevaluated:true}
  const validators = new ajv.default(opts).addSchema(schemas);
  </code></pre>
  <p>but still no luck.</p>
  <p>What do I need to do to enable <code>unevaluatedProperties</code>?</p>