diff --git a/src/crud.js b/src/crud.js index 7ac31fc..fa856c7 100644 --- a/src/crud.js +++ b/src/crud.js @@ -62,8 +62,9 @@ export default (server, model, { prefix, defaultConfig: config, models: permissi return params; }, {}); + const validAssociations = joi.string().valid(...modelAssociations); const associationValidation = { - include: joi.array().items(joi.string().valid(...modelAssociations)), + include: [joi.array().items(validAssociations), validAssociations], }; const scopes = Object.keys(model.options.scopes);