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).
[
{
"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
- Read
params.additionalPropertyto see the offending key. - Correct the spelling to a defined property, or delete the key.
- Re-run
ajv validateto confirm.
Add the property to the schema
If the field is valid, declare it under properties so the strict schema accepts it.
{
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"version": { "type": "string" }
}
}How to prevent it
- Keep
additionalProperties: falseto 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.