Skip to content
Latchkey

ajv "must NOT have additional properties" in CI

The schema sets additionalProperties: false, so ajv rejects any key it does not explicitly define. It reports "must NOT have additional properties" and names the extra property.

What this error means

ajv-cli fails with "must NOT have additional properties" and params.additionalProperty naming the offending key (often a typo of a valid one).

ajv
[
  {
    "instancePath": "",
    "schemaPath": "#/additionalProperties",
    "keyword": "additionalProperties",
    "params": { "additionalProperty": "versionn" },
    "message": "must NOT have additional properties"
  }
]

Common causes

A misspelled key not defined in the schema

A typo like versionn is not a declared property, and additionalProperties: false forbids unknown keys.

A new field the schema has not been updated for

The config added a legitimate field the schema does not yet list, so a strict schema rejects it.

How to fix it

Fix the typo or remove the stray key

  1. Read params.additionalProperty to see the offending key.
  2. Correct the spelling to a defined property, or delete the key.
  3. Re-run ajv validate to confirm.

Add the property to the schema

If the field is valid, declare it under properties so the strict schema accepts it.

schema.json
{
  "additionalProperties": false,
  "properties": {
    "name": { "type": "string" },
    "version": { "type": "string" }
  }
}

How to prevent it

  • Keep additionalProperties: false to catch typos, and update the schema for real new fields.
  • Validate in a pre-commit hook so unknown keys fail before merge.
  • Review schema changes alongside config changes.

Frequently asked questions

What causes ""must NOT have additional properties""?
A typo like versionn is not a declared property, and additionalProperties: false forbids unknown keys.
How do I fix "must NOT have additional properties"?
Fix the typo or remove the stray key

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card