Skip to content
Settings

INVALID_UNIQUE_KEY_DEFINITION — unique key definition is structurally invalid

cyoda-go version 0.8.2

INVALID_UNIQUE_KEY_DEFINITION — a model’s unique key definition is structurally invalid and cannot be used.

HTTP: 422 Unprocessable Entity. Retryable: no.

Each unique key on a model must have a non-empty list of field paths, a unique name within the model, and field paths that resolve to existing, non-ambiguous fields in the model schema. This error is returned when a submitted model definition violates one of these structural requirements.

To resolve: correct the unique key definition — ensure every key has a name, at least one field path, no duplicate key names within the model, and that all referenced field paths exist in the model schema.

  • errors
  • errors.INVALID_UNIQUE_KEY
  • errors.COMPOSITE_KEY_UNSUPPORTED
  • 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 INVALID_UNIQUE_KEY — A composite unique key requires every declared field to be present and non-null. This error is returned when the entity payload is missing a value for at least one key field, or the value cannot be normalized to a valid claim (for example, a NaN or ±Infinity for a numeric key field).
  • cyoda help errors COMPOSITE_KEY_UNSUPPORTED — Composite unique key enforcement is an optional capability that storage backends may or may not implement. This error is returned when a model defines one or more unique keys but the backend does not implement the CompositeUniqueKeyCapable interface.