From 105b471cc6f95e2aedcf4dd3535179bf6b1b3e6d Mon Sep 17 00:00:00 2001 From: dongfang <1136005348@qq.com> Date: Thu, 13 Feb 2025 00:56:16 +0000 Subject: [PATCH] allow empty string for json validation in server side --- Server/validation/joi.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Server/validation/joi.js b/Server/validation/joi.js index b60022fc5..c0ccc1fe9 100644 --- a/Server/validation/joi.js +++ b/Server/validation/joi.js @@ -194,8 +194,8 @@ const createMonitorBodyValidation = joi.object({ }), notifications: joi.array().items(joi.object()), secret: joi.string(), - jsonPath: joi.string(), - expectedValue: joi.string(), + jsonPath: joi.string().allow(""), + expectedValue: joi.string().allow(""), matchMethod: joi.string(), }); @@ -205,8 +205,8 @@ const editMonitorBodyValidation = joi.object({ interval: joi.number(), notifications: joi.array().items(joi.object()), secret: joi.string(), - jsonPath: joi.string(), - expectedValue: joi.string(), + jsonPath: joi.string().allow(""), + expectedValue: joi.string().allow(""), matchMethod: joi.string(), });