A handler that imports ./fixtures/products.json and returns it pretends to be a real endpoint while serving static bytes. Data never updates, writes are impossible, and the client cache treats stale fixture data as authoritative. Because the response shape looks plausible, bugs hide for weeks until a user edits a record and the change silently disappears. Fixture-backed endpoints also bypass the database entirely, so inventory counts, pricing, and permissions drift from reality immediately.
High because fixture-backed endpoints defeat every write path and make stale data indistinguishable from live data.
Seed the fixture into the database once (for example from prisma/seed.ts) and have the handler query the database instead. Keep the JSON file under prisma/ or db/seed/ so its purpose is obvious. Fix the handler at app/api/products/route.ts:
import { prisma } from '@/lib/db'
export async function GET() {
const products = await prisma.product.findMany()
return Response.json(products)
}
ID: ai-slop-half-finished.mock-responses.fake-json-responses
Severity: high
What to look for: Walk all API handler files and count imports of JSON files from paths matching **/fixtures/**, **/mock-data/**, **/seed-data/**, **/sample/**, **/samples/**, **/dummy/**, **/stub/**, **/stubs/**, OR any import X from './something.json' where the JSON file is inside the same project (not node_modules). For each match, check whether the imported JSON data is used as the handler's response body (returned directly or after a simple transformation). Count all handlers using fixture JSON as their response source.
Pass criteria: 0 API handlers return data sourced from project-local JSON fixture files. Report: "Scanned X API handlers, 0 use fixture JSON as response source."
Fail criteria: At least 1 API handler imports a project-local JSON file from a fixture/mock path AND returns its contents.
Skip (N/A) when: Project has 0 API handler files.
Detail on fail: "1 handler returns fixture JSON: app/api/products/route.ts imports './fixtures/products.json' and returns it as the response body"
Remediation: Fixture JSON is for tests or seeding a database, not for production responses. Move the data into a real database and query it:
// Bad: app/api/products/route.ts
import products from './fixtures/products.json'
export async function GET() {
return Response.json(products)
}
// Good: seed the fixture into the database once, then query
// (prisma/seed.ts imports fixtures/products.json and inserts once)
// app/api/products/route.ts
import { prisma } from '@/lib/db'
export async function GET() {
const products = await prisma.product.findMany()
return Response.json(products)
}