payloadSchemaJson top-level constant
String
const payloadSchemaJson
This specification's payload schema, as JSON text.
SPEC §7.2 item 2 is performed against this. It ships with the library rather than only as a file under specs/ because a Dart class carries none of the schema's constraints — not minLength, not pattern, not the oneOf mutual exclusion — so without it every such rule is unenforced. Cross-file $refs are already inlined, so it needs no resolver.
Implementation
const String payloadSchemaJson =
'{"\$schema":"https://json-schema.org/draft/2020-12/schema","\$id":"https://trusttasks.org/spec/trust-task-error/0.2","title":"Trust Task Error — payload","description":"The canonical error-response payload per SPEC.md §8.2.","type":"object","additionalProperties":false,"required":["code","retryable"],"properties":{"code":{"type":"string","description":"Short identifier for the failure category. MUST be either a framework standard code (SPEC.md §8.3) or an extended code namespaced by the originating spec\'s slug (SPEC.md §8.5, e.g. \'acl/grant:roleNotRecognized\').","anyOf":[{"enum":["malformedRequest","unsupportedType","unsupportedVersion","expired","proofRequired","proofInvalid","permissionDenied","wrongRecipient","identityMismatch","taskFailed","unavailable","internalError"]},{"pattern":"^[a-z][a-z0-9]*(-[a-z0-9]+)*(/[a-z][a-z0-9]*(-[a-z0-9]+)*)*:[a-z][a-zA-Z0-9_]*\$"}]},"message":{"type":"string","maxLength":1024,"description":"Human-readable description of the error. Non-normative; intended for logs and operator UI."},"retryable":{"type":"boolean","description":"true if the producer of the original document MAY retry; false if retrying with the same document is not expected to succeed."},"retryAfter":{"type":"string","format":"date-time","description":"RFC 3339 timestamp before which the producer SHOULD NOT retry. Meaningful only when retryable is true."},"details":{"type":"object","description":"Optional task-specific extension data. Per-spec error code declarations may pin the shape via a JSON Schema fragment."}}}';