PRECONDITION_REQUIRED — PATCH request missing required If-Match header
cyoda-go version 0.8.4
errors.PRECONDITION_REQUIRED
Section titled “errors.PRECONDITION_REQUIRED”PRECONDITION_REQUIRED — a PATCH request was submitted without an If-Match header, which is mandatory for patch operations.
SYNOPSIS
Section titled “SYNOPSIS”HTTP: 428 Precondition Required. Retryable: no.
DESCRIPTION
Section titled “DESCRIPTION”PATCH applies a merge patch to the entity’s stored state rather than replacing it wholesale. Because the patch is applied relative to the current stored data, cyoda-go requires the caller to state a precondition explicitly via If-Match. Omitting the header entirely is rejected.
This behaviour is specific to PATCH. A PUT without If-Match is treated as an unconditional replace and is accepted.
Not retryable as-is — the same request without an If-Match header produces the same error.
RECOVERY
Section titled “RECOVERY”Add an If-Match header to the PATCH request. Two modes are supported:
- Conditional patch — supply the
transactionIdobtained from your most recent GET of the entity as theIf-Matchvalue. The patch is applied only if the entity has not changed since that read; a412 ENTITY_MODIFIEDis returned if another writer has committed in the meantime. - Unconditional patch (last-writer-wins) — supply
If-Match: *to explicitly accept that the patch will be applied to whatever the current stored state is, without a version check.
Choose the conditional form when you need to detect concurrent modifications; choose * when you intentionally want last-writer-wins semantics and have already decided the patch is safe to apply regardless of concurrent changes.
SEE ALSO
Section titled “SEE ALSO”- errors
- errors.ENTITY_MODIFIED
- errors.BAD_REQUEST
See also
Section titled “See also”cyoda help errors— Every error response from the Cyoda REST API carries a structurederrorCodein thepropertiesobject. Multiple codes may share the same HTTP status. Programmatic handling keys onerrorCode, not HTTP status.cyoda help errors ENTITY_MODIFIED— When an entity update request carries anIf-Matchheader, the server requires the supplied transaction ID to equal the entity’s currentmeta.transactionId. A mismatch means another writer has updated the entity since the caller’s last read. The optimistic-concurrency guard rejects the update rather than silently overwrite.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.
Raw formats
Section titled “Raw formats”/help/errors/precondition_required.json— full descriptor (matchesGET /help/{topic}envelope)/help/errors/precondition_required.md— body only