Open Eyuelb opened 1 month ago
npx next-rest-framework validate is not working
"custom-generate-openapi": "npx tsx ./scripts/custom-generate-openapi.ts",
import { generate } from 'next-rest-framework/dist/cli/generate'; generate({ configPath: '/api/v2' }) .then(() => { console.log('Completed building OpenAPI schema from custom script.'); }) .catch(console.error);
res: A
configPath
parameter with a value of /api/v2 was provided but no Next REST Framework configs were found."custom-validate-openapi": "npx tsx ./scripts/custom-validate-openapi.ts"
import { validate } from 'next-rest-framework/dist/cli/validate'; validate({ configPath: '/api/v2' }) .then(() => { console.log('Completed validating OpenAPI schema from custom script.'); }) .catch(console.error);
// app/api/v2/route.ts import { docsRoute } from "next-rest-framework"; export const { GET } = docsRoute({ });
"next": "14.2.8", "typescript": "^5.6.2",
tsx
package installedNODE_OPTIONS='--import=tsx' npx next-rest-framework generate
(or NODE_OPTIONS='--import=tsx' pnpm exec next-rest-framework generate
if you use pnpm)
npx next-rest-framework validate is not working
"custom-generate-openapi": "npx tsx ./scripts/custom-generate-openapi.ts",
res: A
configPath
parameter with a value of /api/v2 was provided but no Next REST Framework configs were found."custom-validate-openapi": "npx tsx ./scripts/custom-validate-openapi.ts"
"next": "14.2.8", "typescript": "^5.6.2",