Skip to content

Commit c4b372a

Browse files
authored
chore: Update CLI option to disable using operationId for generating operation names (#165)
1 parent f65ac4e commit c4b372a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/src/content/docs/guides/cli-options.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ The available options are:
5757
- `biome`
5858
- `eslint`
5959

60-
### --operationId
60+
### --noOperationId
6161

62-
Use operation ID to generate operation names? The default value is `true`.
62+
Do not use operation ID to generate operation names. The default value is `true`.
6363

6464
### --enums \<value\>
6565

src/cli.mts

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type LimitedUserConfig = {
1414
client?: "@hey-api/client-fetch" | "@hey-api/client-axios";
1515
format?: "biome" | "prettier";
1616
lint?: "biome" | "eslint";
17-
operationId?: boolean;
17+
noOperationId?: boolean;
1818
enums?: "javascript" | "typescript" | false;
1919
useDateType?: boolean;
2020
debug?: boolean;
@@ -58,7 +58,10 @@ async function setupProgram() {
5858
"Process output folder with linter?",
5959
).choices(["biome", "eslint"]),
6060
)
61-
.option("--operationId", "Use operation ID to generate operation names?")
61+
.option(
62+
"--noOperationId",
63+
"Do not use operationId to generate operation names",
64+
)
6265
.addOption(
6366
new Option(
6467
"--enums <value>",

src/generate.mts

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ export async function generate(options: LimitedUserConfig, version: string) {
3131
services: {
3232
export: true,
3333
asClass: false,
34-
operationId:
35-
formattedOptions.operationId !== undefined
36-
? formattedOptions.operationId
37-
: true,
34+
operationId: !formattedOptions.noOperationId,
3835
},
3936
types: {
4037
dates: formattedOptions.useDateType,

0 commit comments

Comments
 (0)