fix: do not exclude required path params

close #1623
This commit is contained in:
Stephen Zhou
2024-11-18 10:40:29 +08:00
parent 96a49742f3
commit f6cbacec85
+4 -1
View File
@@ -148,7 +148,10 @@ export const parseRegexpPathParams = (
}
})
.filter(
(item) => typeof item === "object" && "name" in item && !excludeNames.includes(item.name),
(item) =>
typeof item === "object" &&
"name" in item &&
(!excludeNames.includes(item.name) || !item.optional),
) as PathParams[]
}
export const parseFullPathParams = (path: string, regexpPath: string) => {