Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pass the operationId option correctly to @hey-api/openapi-ts #151

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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