Skip to content

Commit d250bb5

Browse files
committed
fix(request): build parameter name from deep path for ZodValidationError
1 parent 70e7b1f commit d250bb5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/request.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ export class ZodValidationError extends InputValidationError {
8181
return { pointer: `/${path.join("/")}` };
8282
}
8383

84-
if (path.length !== 1 || typeof path[0] !== "string") {
85-
throw new Error("Query parameters paths must be a single string");
86-
}
87-
88-
return { parameter: path[0] };
84+
return {
85+
parameter: `${path[0]}${path
86+
.slice(1)
87+
.map((element) => `[${element}]`)
88+
.join()}`,
89+
};
8990
}
9091
}
9192

0 commit comments

Comments
 (0)