Topic

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
4 min read

Reusable JSON Schema components in OpenAPI: DRY models without $ref spaghetti

Inline every schema and your request and response models drift apart. Extract everything and the document becomes a maze of one-off references. The middle path is a small set of rules for what becomes a component, what stays inline, and how to name and compose it.

Read article
4 min read

Generate OpenAPI from FastAPI and Django REST without decorating every view

FastAPI puts contracts in annotations; Django REST puts them in serializers and viewsets. A static scanner can recover both without a running server, but the dynamic parts of DRF, external models, source mappings, and runtime choices, must be reported as gaps rather than turned into invented enums.

Read article
4 min read

LLM Structured Outputs and JSON Schema: Tool Calling That Never Drifts

Free-form tool arguments are where agent workflows break: the model invents fields, sends numbers as strings, and omits required values. Structured outputs backed by strict JSON Schema make tool calls deterministic, and most of that schema already exists in your OpenAPI components.

Read article
4 min read

Generate code from the spec, not the spec from the code

Agents guess field names when they never see the contract. Serve the spec over MCP, generate one verified vertical slice at a time, run scenarios against localhost, and rescan to catch drift.

Read article