The Powerduck Blog

API engineering, from the spec out

Product updates, engineering notes, and guides for designing, debugging, testing, mocking, and serving MCP tools from one OpenAPI spec.

Browse the guides
openapi 4 min read

Prevent lost updates with ETag and If-Match: optimistic concurrency in OpenAPI

Two clients PUT the same resource and the last write silently wins. The HTTP fix is conditional requests with ETag, If-Match, and a 412 that tells the client to re-fetch and retry. Here is the exact state table and the OpenAPI that makes codegen and AI agents handle conflicts correctly.

Read article