Skip to content

fix: content-meta schema duplicates then.properties due to AJV strict mode #277

@flyingrobots

Description

@flyingrobots

Problem

docs/contracts/cli/content-meta.schema.json has to duplicate property constraints (sha, mime, size with types/patterns) inside the then block because AJV's strictRequired mode rejects required referencing properties not defined in the local subschema.

This is a workaround for an AJV strict-mode quirk, not a schema design choice. It means any pattern/type change to these fields must be updated in two places.

Possible Fix

  • Investigate AJV config to relax strictRequired for conditional schemas only
  • Or extract shared property definitions into $defs and use $ref in both locations
  • Or accept the duplication and add a comment explaining why

Context

Surfaced during M13 VESSEL review (PR #276, rounds 3-5). CodeRabbit flagged it 3 times before we explained the AJV constraint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt that needs addressing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions