blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
134 stars 17 forks source link

Unable to generate #147

Closed omermecitoglu closed 5 months ago

omermecitoglu commented 5 months ago

added the route below

// ./src/app/api/route.ts

import { docsRoute } from "next-rest-framework";

export const { GET } = docsRoute();

and tried to run the command

npx next-rest-framework generate

then the result was

Compiling endpoints...
Generating OpenAPI spec...
Next REST Framework config not found. Initialize a docs handler to generate the OpenAPI spec.

tried with

"next-rest-framework": "^5.1.11"

blomqma commented 5 months ago

Hello, what Node.js version are you using?

omermecitoglu commented 5 months ago

v20.11.0

I played with the code in the same project that I installed this package for few hours. Then I tried to run the generate command again, just before I was planning to delete the package. And it worked, but I really don't know what did I do, it just worked.

wildseansy commented 1 month ago

I have the same problem. I'm also using nx with pnpm in a mono-repo. Even after changing into the directory for the application with the docsRoute defined, I get this error.

If I specify the --configPath I get the following

> pnpm next-rest-framework generate --configPath app/api/mobile/v1/route.ts 

A `configPath` parameter with a value of app/api/mobile/v1/route.ts was provided but no Next REST Framework configs were found.

Can't seem to figure out how it's trying to find the docsRoute....