Skip to content

Commit 8cdc68d

Browse files
authored
Merge pull request #783 from micheletriaca/patch-1
Fix #782 (coerceTypes errors)
2 parents a51f5d2 + 1ed09d1 commit 8cdc68d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ export class OpenAPIRouter<D extends Document = Document> {
297297
const cookies = cookie.parse(_.flatten([cookieHeader]).join('; '));
298298

299299
// parse query
300-
const queryString = typeof req.query === 'string' ? req.query.replace('?', '') : req.path.split('?')[1];
300+
const qs = typeof req.query === 'object' ? new URLSearchParams(req.query).toString() : req.query;
301+
const queryString = typeof qs === 'string' ? qs.replace('?', '') : req.path.split('?')[1];
301302
const query = typeof req.query === 'object' ? _.cloneDeep(req.query) : parseQuery(queryString);
302303

303304
// normalize

0 commit comments

Comments
 (0)