Skip to content

Commit 86374a3

Browse files
author
carmine
committed
handle req.query mutations for express 5
1 parent 4edacd8 commit 86374a3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/middlewares/openapi.request.validator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,12 @@ export class RequestValidator {
139139
}
140140
req.params = openapi.pathParams ?? req.params;
141141
}
142-
143142
// HACK for express 5, temporarily make req.query mutable
144143
const reqQueryDescriptor = Object.getOwnPropertyDescriptor(req, 'query');
145144
Object.defineProperty(req, 'query', {
146145
writable: true,
147146
value: req.query,
148-
})
147+
});
149148
const schemaProperties = validator.allSchemaProperties;
150149
const mutator = new RequestParameterMutator(
151150
this.ajv,

0 commit comments

Comments
 (0)