Skip to content
Content modellingCMMF 1.2.0

Understand validation errors

Repair common structure and whole-model failures using the portable example validator.

Start from a complete example project, install its locked dependencies with npm ci, then run npm run validate. Keep a working copy before experimenting. The messages below refer to the downloadable example validator; other tools may phrase them differently.

Missing target: customer-story.customer -> customer-missing

The customer field names a model ID that is absent from the loaded set. In the tutorial its targets should be [customer]. Check the target model’s id, the manifest’s model directory and whether every file was included. A filename alone does not define the target ID.

Incorrect object kind: quote

An objectType must resolve to an object model. Restore kind: object on Quote if it is intended to be embedded. If the brief instead requires independent quote entries, review the relationship design and use a reference deliberately.

Duplicate model ID: customer-story
Duplicate field ID: customer-story.title

Model IDs must be unique within the set; field IDs must be unique within their model. Remove accidental duplicate definitions. If these are distinct concepts, choose distinct IDs and update references and editorial metadata together.

Missing editorial field: customer-story.absent

The model’s labelField or preview refers to a field that does not exist. Use the current field ID, or remove a preview role the model no longer provides.

customer-story.title: minLength exceeds maxLength

The maximum cannot be lower than the minimum. Agree the intended bounds, then change the values. Character and item counts in the example validator must also be non-negative integers. This checks the declared rules; it does not inspect actual story text.

Schema failures include an AJV error array. Its instancePath identifies the property location; keyword names the failed rule. Look for the actionable error in the array, since a conditional rule may produce several related messages.

Common causes include missing objectType, missing reference targets, an unknown canonical type, or conflicting list and legacy relation.cardinality. See the type reference and migration guide.

The example validator requires the manifest string "1.2.0". A different declared version needs matching source material and tooling; changing the label alone is not a migration. YAML parser errors identify the file and location. Check indentation, repeated keys and quoted strings before debugging relationships.

Run validation again after each repair. Then review editorial usefulness and any CMS mapping separately. A passing check has the scope described here.