Should I use JSON Merge Patch or JSON Patch for partial updates?
Default to Merge Patch with ETag/If-Match, and switch specific endpoints to JSON Patch only for element-level array edits or conditional multi-field ops.
Tag
REST and modern API design: contracts, versioning, error shape and consumption practices. Questions under this tag, answered directly.
6 answered questions carry this tag.
Default to Merge Patch with ETag/If-Match, and switch specific endpoints to JSON Patch only for element-level array edits or conditional multi-field ops.
Make most changes additively and never remove or retype a field; for an unavoidable break, pin the version with a header instead of cutting /v2.
Standardize on RFC 9457 rather than 7807, produce every error body in one central exception handler, and manage the type URI as a versionable contract.
Go contract-first with openapi.yaml as the single source of truth; what ends drift isn't the direction you pick but a green contract test running in CI.
Instrument usage per partner, publish a dated sunset with Sunset and Deprecation headers on every response, run brownouts, and cut when usage nears zero.
Verify the HMAC constant-time over the raw body, return 200 fast and enqueue the work, and let a UNIQUE constraint on event_id enforce once-only.