When Codegen Ignores format: uuid, email, and uri and Gives You a Plain String
Why codegen turns format hints into plain strings and how to validate UUIDs, emails, and URIs yourself.
Tag archive
Why codegen turns format hints into plain strings and how to validate UUIDs, emails, and URIs yourself.
Quick guidance on codegen for binary downloads: streaming a file response instead of decoding it as text.
Generated Clients and Error Responses: Typing 4xx/5xx Bodies Instead of Throwing Blind — a practical, contract-based look at the failure mode and how to handle it.
How generators handle circular OpenAPI references, where they fall back to any, and how to validate recursive output.
readOnly and writeOnly let a generator split response and request models; collapsed create models force clients to fake server-owned fields.
Model oneOf with an explicit discriminator and tag, inspect the generated type, and accept only a tagged union; contain flattening generators at a narrowing boundary.
Generators map date-time to raw strings, pushing timezone and ordering bugs onto every caller, so map to a real temporal type or centralize parsing.
Keep map keys open but pin the value type, and verify the generated client preserves it.
Decide whether each enum is closed or open; tolerate unknown values for evolving categories instead of crashing on additive changes.
A practical OpenAPI code generation guide covering typed clients, server stubs, spec recovery, and avoiding type drift.
Most code generators assume you never touch what they produce. That assumption rarely holds. Someone...
operationId becomes the method name in every generated SDK and tags become the namespace and the docs sidebar, yet most specs treat both as afterthoughts. Duplicate ids, verb-first names, and a unique tag per endpoint produce unusable clients and a wall of operations. Here is a naming system...