Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/early-kings-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"swagger-typescript-api": patch
---

Add boolean type for `extract-request-params` in command configuration.
5 changes: 5 additions & 0 deletions .changeset/easy-paths-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"swagger-typescript-api": patch
---

Fix generateClient logic to exclude only 'no-client' argument.
5 changes: 5 additions & 0 deletions .changeset/moody-dodos-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"swagger-typescript-api": patch
---

Initialise `customConfig` to `undefined` in command run function.
5 changes: 3 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const generateCommand = defineCommand({
default: codeGenBaseConfig.enumNamesAsValues,
},
"extract-request-params": {
type: "boolean",
description:
"extract request params to data contract (Also combine path params and query params into one object)",
default: codeGenBaseConfig.extractRequestParams,
Expand Down Expand Up @@ -280,7 +281,7 @@ const generateCommand = defineCommand({
},
},
run: async ({ args }) => {
let customConfig;
let customConfig = undefined;

if (args["custom-config"]) {
try {
Expand Down Expand Up @@ -314,7 +315,7 @@ const generateCommand = defineCommand({
extractResponseError: args["extract-response-error"],
extractResponses: args["extract-responses"],
fileName: args.name,
generateClient: !(args.axios || args["no-client"]),
generateClient: !args["no-client"],
generateResponses: args.responses,
generateRouteTypes: args["route-types"],
generateUnionEnums: args["union-enums"],
Expand Down