Skip to content

Commit cca05cb

Browse files
committed
fix: update Axios method to be asynchronous and clean up package.json formatting
This commit includes: - Changed the Axios method to be asynchronous, improving handling of promises. - Cleaned up the formatting in package.json for consistency.
1 parent 0926a42 commit cca05cb

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"license": "MIT",
55
"description": "Generate Axios API clients and React Query options from OpenAPI specifications",
66
"exports": "./dist/index.js",
7-
"files": [
8-
"src",
9-
"dist"
10-
],
7+
"files": ["src", "dist"],
118
"author": {
129
"name": "Oliver Winter",
1310
"email": "[email protected]"

src/generator/clientGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function generateAxiosMethod(operation: OperationInfo, spec: OpenAPIV3.Document)
155155

156156
return `
157157
${jsDocLines.join("\n ")}
158-
export function ${camelCase(operationId)}(data${hasData ? `: ${dataType}` : "?: undefined"}, config?: AxiosRequestConfig): Promise<AxiosResponse<${responseType}>> {
158+
export async function ${camelCase(operationId)}(data${hasData ? `: ${dataType}` : "?: undefined"}, config?: AxiosRequestConfig): Promise<${responseType}> {
159159
${methodBody}
160160
}`;
161161
}

0 commit comments

Comments
 (0)