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 663e1e8 commit 6530304Copy full SHA for 6530304
src/common/logger.js
@@ -143,7 +143,14 @@ logger.decorateWithValidators = function (service) {
143
service[name] = async function () {
144
const args = Array.prototype.slice.call(arguments);
145
const value = _combineObject(params, args);
146
- const normalized = Joi.attempt(value, method.schema);
+
147
+ // Convert plain object schema to Joi schema if needed
148
+ let schema = method.schema;
149
+ if (schema && !schema.validate && typeof schema === 'object') {
150
+ schema = Joi.object().keys(schema);
151
+ }
152
153
+ const normalized = Joi.attempt(value, schema);
154
155
const newArgs = [];
156
// Joi will normalize values
0 commit comments