Types

An item, progress or result schema is an array of field objects. Each object names itself with a taskhoster-name entry and declares a taskhoster-type that fixes how a submitted value is validated and coerced. A field object is { "taskhoster-name": …, "taskhoster-type": …, "taskhoster-required": bool, "taskhoster-max": N }; an enum also carries a taskhoster-values array. An omitted taskhoster-type defaults to text.

The field types

TypeAcceptsStored as
textAny string. Kept exactly as sent (not trimmed).string
emailA string matching local@domain.tld (one @, a dotted domain, no whitespace). Trimmed.string
urlA string starting http:// or https:// with no whitespace. Trimmed.string
integerA whole number, optionally signed (e.g. -12). Parsed to a number.number
numberAny finite decimal (e.g. 3.14, -0.5). Parsed to a number.number
booleanA JSON true/false, or one of true/1/yes/on and false/0/no/off (case-insensitive).boolean
enumA string that is exactly one of the declared taskhoster-values.string
blobBase64 text (characters A–Z a–z 0–9 + / and up to two trailing =). Carries arbitrary binary while keeping the item file plain text.string (base64)

The spec keys

KeyApplies toMeaning
taskhoster-nameallThe field's name: a non-empty string, unique within the schema. Required on every field object.
taskhoster-typeallOne of the types above. Defaults to text if omitted.
taskhoster-requiredalltrue to reject a submission that omits the field (or sends it empty/null). Defaults to false.
taskhoster-maxallMaximum length of the submitted string, checked before coercion. Defaults to 8000; for a blob, 8388608 (8 MiB). A non-positive or non-integer taskhoster-max is ignored and the default used.
taskhoster-valuesenumA non-empty array of the allowed strings. Required for an enum; a definition without it is rejected on push.

How validation works

A failed submission returns every error at once, e.g. { "ok": false, "errors": ["url is required", "format: must be one of: png, jpg"] }.

A blob's taskhoster-max limits the length of the base64 text, not the decoded bytes. Base64 is roughly a third larger than the raw data, so budget the taskhoster-max accordingly.

Examples

"taskhoster-schema-item": [
  { "taskhoster-name": "url",     "taskhoster-type": "url", "taskhoster-required": true },
  { "taskhoster-name": "format",  "taskhoster-type": "enum", "taskhoster-values": ["png", "jpg", "webp"] },
  { "taskhoster-name": "width",   "taskhoster-type": "integer" },
  { "taskhoster-name": "quality", "taskhoster-type": "number" },
  { "taskhoster-name": "sharpen", "taskhoster-type": "boolean" },
  { "taskhoster-name": "note",    "taskhoster-type": "text", "taskhoster-max": 280 },
  { "taskhoster-name": "blob",    "taskhoster-type": "blob", "taskhoster-max": 5000000 }
]