Skip to content
Settings

VALIDATION_FAILED — payload fails model schema validation

cyoda-go version 0.8.4

VALIDATION_FAILED — the request payload is structurally valid JSON but fails the model’s schema or workflow validation rules.

HTTP: 400 Bad Request. Retryable: no.

Unlike BAD_REQUEST (which covers parse failures, bad parameters, and unstorable bytes), this error is returned when the payload parsed and then failed against the registered model. On an entity write that means:

  • a field the model does not declare (unexpected field not present in model)
  • a value whose JSON kind the field does not declare (expected scalar, got array)
  • a change the model’s changeLevel does not permit
  • a field name the wire jsonPath grammar cannot address

On a workflow import (POST /model/{entityName}/{modelVersion}/workflow/import), this is also the code for a structural content violation, including a criterion group clause whose operator is not AND, OR, or NOT, or a NOT group whose conditions does not hold exactly one entry — see workflows and predicates. This is a grammar-only check at import time; it does not verify that the model declares every field a criterion names (see errors.WORKFLOW_FAILED).

It is also returned by the model import for sample data that is neither a document nor a collection of documents, and by the workflow import for a structural violation. The error detail names the offending path or key.

A leaf value whose DataType is not assignable carries the more specific INCOMPATIBLE_TYPE instead, with fieldPath, expectedType and actualType in properties. Missing fields are NOT an error: a model describes the structure it has observed, not a set of required fields.

Correct the payload to match the model, or extend the model — export it and compare.

  • errors
  • errors.BAD_REQUEST
  • errors.WORKFLOW_FAILED
  • workflows
  • predicates
  • cyoda help errors — Every error response from the Cyoda REST API carries a structured errorCode in the properties object. Multiple codes may share the same HTTP status. Programmatic handling keys on errorCode, not HTTP status.
  • cyoda help errors BAD_REQUEST — Fired when the server cannot parse or structurally process the incoming request. Common triggers include invalid JSON, unsupported format specifiers, a parameter outside its allowed range, and mutually exclusive parameters set together.
  • cyoda help errors WORKFLOW_FAILED — During an entity create or transition operation the associated workflow processors (pre-processors, post-processors) or guard conditions ran but one of them signalled failure. The failure message from the processor is included in the error detail.
  • cyoda help workflows — A workflow definition is a named finite state machine attached to an entity model. Workflows are stored per model reference (entityName, modelVersion). A model may have multiple workflow definitions; the engine selects the matching one per entity using the workflow-level criterion field evaluated at entity creation time. When no criterion matches, the engine uses the default built-in workflow.
  • cyoda help predicates — predicates — operator catalog and evaluation semantics for the Condition DSL used by search (cyoda help search) and workflow/transition criteria (cyoda help workflows). Both consume the same kernel, so everything here applies identically to both.