Skip to content

Commit

Permalink
chore: Update CLI option to disable using operationId for generating …
Browse files Browse the repository at this point in the history
…operation names (#165)
  • Loading branch information
7nohe authored Oct 14, 2024
1 parent f65ac4e commit c4b372a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/cli-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ The available options are:
- `biome`
- `eslint`

### --operationId
### --noOperationId

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

### --enums \<value\>

Expand Down
7 changes: 5 additions & 2 deletions src/cli.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type LimitedUserConfig = {
client?: "@hey-api/client-fetch" | "@hey-api/client-axios";
format?: "biome" | "prettier";
lint?: "biome" | "eslint";
operationId?: boolean;
noOperationId?: boolean;
enums?: "javascript" | "typescript" | false;
useDateType?: boolean;
debug?: boolean;
Expand Down Expand Up @@ -58,7 +58,10 @@ async function setupProgram() {
"Process output folder with linter?",
).choices(["biome", "eslint"]),
)
.option("--operationId", "Use operation ID to generate operation names?")
.option(
"--noOperationId",
"Do not use operationId to generate operation names",
)
.addOption(
new Option(
"--enums <value>",
Expand Down
5 changes: 1 addition & 4 deletions src/generate.mts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export async function generate(options: LimitedUserConfig, version: string) {
services: {
export: true,
asClass: false,
operationId:
formattedOptions.operationId !== undefined
? formattedOptions.operationId
: true,
operationId: !formattedOptions.noOperationId,
},
types: {
dates: formattedOptions.useDateType,
Expand Down

0 comments on commit c4b372a

Please sign in to comment.