Start with the contract boundary
Name the consumer and provider before filling in fields. A useful API spec answers who calls the endpoint, what business event it represents, which version owns it, and what compatibility promise future changes must respect.
Make request and response examples realistic
Examples should include real-looking identifiers, timestamps, enum values, pagination fields, and error shapes. A schema without examples leaves client teams guessing about nullability, defaults, and field naming conventions.
Define errors as product behavior
Error responses are part of the contract. Document stable error codes, retry guidance, validation messages, authentication failures, rate limits, and what clients should show users or log for support.
Export OpenAPI after the human review
Use the Markdown output for discussion first. Once endpoint behavior is agreed, export OpenAPI YAML so client generation, mock servers, contract tests, and documentation can share the same source.