We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a15092 commit af770baCopy full SHA for af770ba
src/index.ts
@@ -176,13 +176,16 @@ function validatePathParam(params: ParamMap, key: string) {
176
if (!Object.hasOwn(params, key)) {
177
throw new Error(`Missing value for path parameter ${key}.`)
178
}
179
+
180
const type = typeof params[key]
181
182
if (type !== 'boolean' && type !== 'string' && type !== 'number') {
183
throw new TypeError(
184
`Path parameter ${key} cannot be of type ${type}. ` +
185
'Allowed types are: boolean, string, number.',
186
)
187
188
189
if (type === 'string' && (params[key] as string).trim() === '') {
190
throw new Error(`Path parameter ${key} cannot be an empty string.`)
191
0 commit comments