Skip to content
Settings

CONDITION_TYPE_MISMATCH — search condition value type incompatible with field

cyoda-go version 0.7.1

CONDITION_TYPE_MISMATCH — a search condition value’s JSON type is incompatible with the field’s locked DataType in the model schema.

HTTP: 400 Bad Request. Retryable: no.

Each field in a locked model has an inferred DataType (e.g. INTEGER, DOUBLE, BOOLEAN). When a search condition references a numeric or boolean field, the condition’s value must be type-compatible with that field. For example, submitting a string value "abc" against a DOUBLE field is rejected.

String fields are not strictly enforced — any comparison value (numeric or string) is accepted to support lexicographic and coerced comparisons. Conditions that reference field paths not present in the model schema are rejected by a separate pre-execution validation pass with INVALID_FIELD_PATH (see issue #77); the type-checker itself has no opinion on unknown paths.

IS_NULL and NOT_NULL operators bypass type checking entirely. Null values are compatible with any field type.

Correct the condition value so that its type matches the target field’s declared DataType.

  • errors
  • errors.BAD_REQUEST
  • errors.INVALID_FIELD_PATH
  • errors.VALIDATION_FAILED
  • 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, missing required fields, unsupported format specifiers, or mutually exclusive parameters being set simultaneously.
  • cyoda help errors INVALID_FIELD_PATH — Before executing a search, the server validates that every data-field path referenced by the condition (e.g. $.price, $.profile.email) resolves against the target model’s locked schema. Lifecycle paths (state, previousTransition, etc.) and meta paths ($._meta.*) bypass this check.
  • cyoda help errors VALIDATION_FAILED — Unlike BAD_REQUEST (which covers parse failures), this error is returned when the payload is parseable but violates the registered model schema — for example, a required field is missing, a value is out of the allowed range, or a workflow guard condition is not satisfied. The error detail includes the specific validation failure.