Skip to content

Commit 1f73987

Browse files
committed
Merge branch 'main' into default-request-params
2 parents e1c2ff4 + 995f6db commit 1f73987

File tree

3 files changed

+280
-234
lines changed

3 files changed

+280
-234
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"typedoc": "typedoc"
4747
},
4848
"dependencies": {
49-
"@biomejs/js-api": "3.0.0",
50-
"@biomejs/wasm-nodejs": "2.2.7",
49+
"@biomejs/js-api": "4.0.0",
50+
"@biomejs/wasm-nodejs": "2.3.3",
5151
"@types/lodash": "^4.17.20",
5252
"@types/swagger-schema-official": "^2.0.25",
5353
"c12": "^3.3.0",
@@ -63,17 +63,17 @@
6363
"yaml": "^2.8.1"
6464
},
6565
"devDependencies": {
66-
"@biomejs/biome": "2.2.7",
66+
"@biomejs/biome": "2.3.3",
6767
"@changesets/changelog-github": "0.5.1",
6868
"@changesets/cli": "2.29.7",
6969
"@tsconfig/node20": "20.1.6",
70-
"@tsconfig/strictest": "2.0.6",
71-
"@types/node": "24.9.1",
70+
"@tsconfig/strictest": "2.0.7",
71+
"@types/node": "24.10.0",
7272
"@types/swagger2openapi": "7.0.4",
73-
"axios": "1.12.2",
74-
"tsdown": "0.15.9",
73+
"axios": "1.13.1",
74+
"tsdown": "0.15.12",
7575
"typedoc": "0.28.14",
76-
"vitest": "4.0.2"
76+
"vitest": "4.0.6"
7777
},
7878
"packageManager": "[email protected]",
7979
"engines": {

src/schema-routes/schema-routes.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ export class SchemaRoutes {
6565
]);
6666
}
6767

68-
createRequestsMap = (routeInfoByMethodsMap) => {
69-
const parameters = lodash.get(routeInfoByMethodsMap, "parameters");
68+
createRequestsMap = (routesByMethod) => {
69+
const parameters = lodash.get(routesByMethod, "parameters");
7070

7171
return lodash.reduce(
72-
routeInfoByMethodsMap,
72+
routesByMethod,
7373
(acc, requestInfo, method) => {
7474
if (
7575
method.startsWith("x-") ||
@@ -91,10 +91,9 @@ export class SchemaRoutes {
9191
);
9292
};
9393

94-
parseRouteName = (originalRouteName) => {
94+
parseRouteName = (rawRoute) => {
9595
const routeName =
96-
this.config.hooks.onPreBuildRoutePath(originalRouteName) ||
97-
originalRouteName;
96+
this.config.hooks.onPreBuildRoutePath(rawRoute) || rawRoute;
9897

9998
// TODO forbid leading symbols [\]^` in a major release (allowed yet for backwards compatibility)
10099
const pathParamMatches = (routeName || "").match(
@@ -157,15 +156,16 @@ export class SchemaRoutes {
157156
);
158157

159158
for (const paramName of paramNames) {
160-
// @ts-expect-error TS(2339) FIXME: Property 'includes' does not exist on type 'unknow... Remove this comment to see the full error message
161-
if (paramName.includes("-")) {
159+
if (typeof paramName === "string" && paramName.includes("-")) {
162160
consola.warn("wrong query param name", paramName);
163161
}
164162

165163
queryParams.push({
166164
$match: paramName,
167-
// @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message
168-
name: lodash.camelCase(paramName),
165+
name:
166+
typeof paramName === "string"
167+
? lodash.camelCase(paramName)
168+
: lodash.camelCase(String(paramName)),
169169
required: true,
170170
type: "string",
171171
description: "",
@@ -178,7 +178,7 @@ export class SchemaRoutes {
178178
}
179179

180180
const result = {
181-
originalRoute: originalRouteName || "",
181+
originalRoute: rawRoute || "",
182182
route: fixedRoute,
183183
pathParams,
184184
queryParams,
@@ -241,9 +241,7 @@ export class SchemaRoutes {
241241
routeParam.name = lodash.camelCase(routeParam.name);
242242
}
243243

244-
if (routeParam) {
245-
routeParams[routeParam.in].push(routeParam);
246-
}
244+
routeParams[routeParam.in].push(routeParam);
247245
});
248246

249247
// used in case when path parameters is not declared in requestInfo.parameters ("in": "path")
@@ -418,8 +416,7 @@ export class SchemaRoutes {
418416
lodash.reduce(
419417
requestInfos,
420418
(acc, requestInfo, status) => {
421-
// @ts-expect-error TS(2554) FIXME: Expected 2 arguments, but got 1.
422-
const contentTypes = this.getContentTypes([requestInfo]);
419+
const contentTypes = this.getContentTypes([requestInfo], operationId);
423420

424421
return [
425422
...acc,

0 commit comments

Comments
 (0)