Most teams treat their OpenAPI spec as a build artifact. Generate it from code, commit it, move on. The spec is technically correct — paths, methods, parameters, response types are all there. But it is not useful to the humans and tools that consume it.
This checklist covers the 18 most common spec gaps, organized by the same 5 categories that API-Clarity scores. If you work through this list, you will move a D-grade spec to a B or better.
Structural Analysis
These are the highest-weight items in the scoring model (40 points total).
1. Every endpoint has a summary
The summary is the one-line label that appears in API explorers, SDK method names, and AI assistant context. “Create a payment” is good. “POST /payments” is not a summary, it is a path.
2. Every endpoint has a description
The summary says what. The description says when, why, and what to watch out for. Even two sentences is meaningfully better than nothing.
3. Every success response has an example
Developers build against examples, not schemas. If there is no example in the spec, every tool that consumes the spec — SDK generators, AI assistants, API explorers — produces output with no concrete data. Add at least one realistic example to every 200/201 response.
4. Every error response has an example
Error examples are more valuable than success examples for debugging integrations. A developer hitting a 422 for the first time needs to see what the error body looks like. If it is not in the spec, they have to hit the API and guess.
5. Every 4xx response is documented At minimum: 400, 401, 422, 429. If your endpoint can return a 404, document it. Document what the response body looks like. “Unauthorized” as a description is not documentation.
6. Every parameter has a description
amount is not enough. Is it in cents or dollars? What is the minimum? What happens if it is 0? Parameter descriptions are where integrations succeed or fail on the first attempt.
7. Parameters have example values
An example is faster to understand than any description. "example": "price_1MowQvLkdIwHu7ixraBm64bi" tells a developer everything they need.
8. Request bodies have examples
Not just a schema. A full, realistic JSON or YAML example that a developer can copy, paste, and modify.
Authentication
Authentication is weighted 20 points because auth friction is the most common reason developers abandon integrations before they ship.
9. Security schemes are defined in components/securitySchemes
If your API requires authentication and there is no security scheme defined, every tool that consumes the spec assumes it is a public API. SDK generators produce clients with no auth handling. AI assistants write integration code that does not authenticate.
10. The security scheme description explains how to get credentials
“API key authentication” is not enough. Where does a developer get the key? Is it in the dashboard under Settings > API? Is it per-environment? The description field accepts Markdown — use it.
11. OAuth flows document the authorization URL, token URL, and scopes If you use OAuth, every flow (authorization_code, client_credentials, etc.) should have the correct URLs and a list of scopes with descriptions. Developers integrating via SDK should not need to read a separate guide to understand what scopes to request.
12. Token refresh is documented If access tokens expire, say so. Document the refresh flow. Document what error code is returned on expiry (usually 401 with a specific error body). This is the most common source of production incidents in OAuth integrations.
Code Samples
Code samples score up to 15 points and are the single highest-ROI addition to a spec.
13. Top endpoints have x-code-samples
The x-code-samples extension is supported by Readme, Mintlify, Redoc, and most API explorer tools. It lets you embed curl, Python, Node.js, and other examples directly in the spec. The content already exists in your quickstart guide — move it into the spec.
Example structure:
x-code-samples:
- lang: Shell
label: cURL
source: |
curl https://api.example.com/v1/payments \
-H "Authorization: Bearer $API_KEY" \
-d amount=2000 \
-d currency=usd
- lang: Python
source: |
import example_sdk
client = example_sdk.Client(api_key="...")
payment = client.payments.create(amount=2000, currency="usd")
14. Code samples use realistic values
"your-api-key" and "example.com" are not helpful. Use realistic-looking values: "sk_test_4eC39HqLyjWDarjtT1zdp7dc" for a Stripe-style key, real endpoint URLs, and plausible parameter values.
Error Handling
15. A default response is defined
The default key in the responses object catches all undocumented status codes. Stripe uses this pattern extensively. Even a generic error schema with a code and message field is better than nothing.
16. Error responses use a consistent schema
If some endpoints return {"error": "message"} and others return {"code": 422, "detail": "message"}, developers cannot write generic error handling. Define an error schema in components/schemas and reference it from every error response.
17. Error descriptions include troubleshooting hints “Payment failed” is a description. “Payment failed — check that the amount is in the smallest currency unit (cents for USD), that the card has not expired, and that the idempotency key is unique per request” is documentation that prevents a support ticket.
Rate Limiting
18. Rate limits are documented in the spec
At minimum: requests per minute or hour, what happens when the limit is exceeded (429 response), and what the retry strategy should be. The x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset headers are a de facto standard — document them.
If you have per-endpoint limits that differ from the global limit, document them on each endpoint.
How to Prioritize
If you cannot fix all 18 at once, work in this order:
- Items 1-8 (structural) — highest weight, most visible to tools
- Items 13-14 (code samples) — highest developer impact per hour of work
- Items 9-12 (auth) — prevents the most common integration failures
- Items 15-17 (error handling) — reduces support volume
- Item 18 (rate limiting) — production reliability
Run API-Clarity before and after to measure the change. A well-documented spec takes 2-4 hours to improve from D to B. The SDK generators, AI assistants, and explorers that consume your spec will use that work indefinitely.