Skip to content

Commit

Permalink
fix: Pass the operationId option correctly to @hey-api/openapi-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
7nohe committed Sep 24, 2024
1 parent 58a6089 commit ef2157e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/generate.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe("generate", () => {
pageParam: "page",
nextPageParam: "meta.next",
initialPageParam: "initial",
operationId: true,
};
await generate(options, "1.0.0");
});
Expand Down

0 comments on commit ef2157e

Please sign in to comment.