diff --git a/examples/nextjs-app/package.json b/examples/nextjs-app/package.json index 2d2eed1..d095d58 100644 --- a/examples/nextjs-app/package.json +++ b/examples/nextjs-app/package.json @@ -9,7 +9,7 @@ "build": "next build", "start": "next start", "lint": "next lint", - "generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome" + "generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome --operationId" }, "dependencies": { "@tanstack/react-query": "^5.32.1", diff --git a/examples/react-app/package.json b/examples/react-app/package.json index d5f8f7c..74c5b34 100644 --- a/examples/react-app/package.json +++ b/examples/react-app/package.json @@ -9,7 +9,7 @@ "dev:mock": "prism mock ../petstore.yaml --dynamic", "build": "tsc && vite build", "preview": "vite preview", - "generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome", + "generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome --operationId", "test:generated": "tsc -p ./tsconfig.openapi.json --noEmit" }, "dependencies": { diff --git a/src/generate.mts b/src/generate.mts index 6026d4f..8b63bb0 100644 --- a/src/generate.mts +++ b/src/generate.mts @@ -34,6 +34,7 @@ export async function generate(options: LimitedUserConfig, version: string) { export: true, response: formattedOptions.serviceResponse, asClass: true, + operationId: formattedOptions.operationId ?? false, }, types: { dates: formattedOptions.useDateType, diff --git a/tests/generate.test.ts b/tests/generate.test.ts index 056c741..9f86e70 100644 --- a/tests/generate.test.ts +++ b/tests/generate.test.ts @@ -22,6 +22,7 @@ describe("generate", () => { pageParam: "page", nextPageParam: "meta.next", initialPageParam: "initial", + operationId: true, }; await generate(options, "1.0.0"); });