Automation · APIs
OpenAPI
Cheat sheet · https://pcornel.dk/topic.php?topic=5316
Answer
Machine-readable API contract describing operations, parameters, schemas, responses and security schemes for tooling and documentation.
Remember
- OpenAPI document ≠ deployed runtime truth; implementation and specification can drift.
- Schema valid ≠ business rule complete; OpenAPI cannot express every semantic constraint.
- Generated client ≠ correct integration automatically; defaults, retries, auth and version lifecycle still require review.
- Documented response ≠ only possible response; gateways and infrastructure can add errors outside the spec.
First checks
npx @redocly/cli lint openapi.yaml— lint specopenapi-generator-cli generate -i openapi.yaml -g python -o client— generate client- Spec version and API version match — consistency
Verify in this order
OpenAPI spec → docs/clients/validation
Where it usually breaks
An OpenAPI document proves the declared interface contract, not that the deployed service implements every detail or business rule.
OpenAPI API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5316