Skip to content

ModelInputProblem

ModelInputProblem = { keys: readonly string[]; reason: "unknownKeys"; } | { keys: readonly string[]; reason: "integerKey"; } | { field: string; pattern: string; reason: "pattern"; value: string; }

Why a factory rejected its input — a discriminated data shape, not a callback, so callers can branch on reason and the shared conformance sweep can read the grammar back out.

  • unknownKeys — input carried keys the model’s fieldMap does not name and the spec does not declare dynamicKeys. The peer of Python’s extra="forbid" (models/_base.py).
  • pattern — a string field’s value fell outside the grammar its spec declares in ModelSpec.patterns.
  • integerKey — a user-supplied YAML key (dynamic key or extras key) is a decimal-integer string, which this port cannot keep in its declared position. See isIntegerLikeKey.