cap: Documentation
Browse Sign In

Validation Rules

RULE1..RULE12 for capability args plus schema validation flow

RULE1..RULE12

  1. RULE1: no duplicate media_urns.
  2. RULE2: sources must not be empty.
  3. RULE3: multiple stdin sources must use identical stdin media URN.
  4. RULE4: no duplicate source type inside one arg.
  5. RULE5: no duplicate positional index across args.
  6. RULE6: positions must be 0-based sequential with no gaps.
  7. RULE7: one arg cannot have both position and cli_flag.
  8. RULE8: unknown source keys rejected by serde deny_unknown_fields.
  9. RULE9: no duplicate cli_flag across args.
  10. RULE10: reserved CLI flags are forbidden (manifest, --help, --version, -v, -h).
  11. RULE11: cli_flag is used verbatim.
  12. RULE12: argument identity is media_urn; no separate name key.

Schema Validation Flow

  1. Resolve media URN via cap-local specs, then registry.
  2. If resolved spec has no JSON schema, skip schema check.
  3. Compile Draft-07 schema (cached by schema JSON).
  4. Validate argument/output JSON value; return detailed validation errors on failure.

Test Anchors

References