API005warningPro

api-type-alignment

Backend endpoints should have response_model; frontend should use generated types.

Applies to: Python, TypeScript

Why this matters

When backend endpoints lack response_model, the OpenAPI spec can't generate TypeScript types. This forces frontend to define inline types that drift from the actual API response shape, causing runtime errors. Use response_model on all endpoints and import generated types in frontend.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, API005 includedstablestack explain API005

API005 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: API005