@sebspark/openapi-typegen 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -6
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -354,12 +354,18 @@ var generateArgs = (args, isServer) => {
|
|
|
354
354
|
const arg = args[part];
|
|
355
355
|
if (arg) {
|
|
356
356
|
const partName = part === "path" ? "params" : part === "header" ? "headers" : part;
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
generateType(arg)
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
357
|
+
if (partName === "query") {
|
|
358
|
+
tokens.push(
|
|
359
|
+
`${partName}${arg.optional ? "?" : ""}: Serialized<${generateType(arg)}>`
|
|
360
|
+
);
|
|
361
|
+
} else {
|
|
362
|
+
tokens.push(
|
|
363
|
+
`${partName}${arg.optional ? "?" : ""}: ${wrapArgs(
|
|
364
|
+
generateType(arg),
|
|
365
|
+
isServer && part === "header"
|
|
366
|
+
)}`
|
|
367
|
+
);
|
|
368
|
+
}
|
|
363
369
|
}
|
|
364
370
|
}
|
|
365
371
|
if (!tokens.length) return "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebspark/openapi-typegen",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/yargs": "17.0.33",
|
|
21
21
|
"tsconfig": "*",
|
|
22
|
-
"vitest": "3.
|
|
22
|
+
"vitest": "3.2.4"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@sebspark/openapi-core": "*",
|
|
26
26
|
"boxen": "<6",
|
|
27
27
|
"chalk": "<5",
|
|
28
28
|
"change-case": "4.1.2",
|
|
29
|
-
"prettier": "3.
|
|
30
|
-
"yaml": "2.
|
|
29
|
+
"prettier": "3.6.0",
|
|
30
|
+
"yaml": "2.8.0",
|
|
31
31
|
"yargs": "17.7.2"
|
|
32
32
|
}
|
|
33
33
|
}
|