Skip to content

Commit ef2157e

Browse files
committed
fix: Pass the operationId option correctly to @hey-api/openapi-ts
1 parent 58a6089 commit ef2157e

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

examples/nextjs-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "next build",
1010
"start": "next start",
1111
"lint": "next lint",
12-
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome"
12+
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome --operationId"
1313
},
1414
"dependencies": {
1515
"@tanstack/react-query": "^5.32.1",

examples/react-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dev:mock": "prism mock ../petstore.yaml --dynamic",
1010
"build": "tsc && vite build",
1111
"preview": "vite preview",
12-
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome",
12+
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ../petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome --operationId",
1313
"test:generated": "tsc -p ./tsconfig.openapi.json --noEmit"
1414
},
1515
"dependencies": {

src/generate.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export async function generate(options: LimitedUserConfig, version: string) {
3434
export: true,
3535
response: formattedOptions.serviceResponse,
3636
asClass: true,
37+
operationId: formattedOptions.operationId ?? false,
3738
},
3839
types: {
3940
dates: formattedOptions.useDateType,

tests/generate.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe("generate", () => {
2222
pageParam: "page",
2323
nextPageParam: "meta.next",
2424
initialPageParam: "initial",
25+
operationId: true,
2526
};
2627
await generate(options, "1.0.0");
2728
});

0 commit comments

Comments
 (0)