From babcf475979ae36c483195dbe4faaa0165fd7a4a Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 6 Aug 2025 16:44:06 -0400 Subject: [PATCH] chore(tools): test for instructions in schema (#60323) Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> --- curriculum/schema/challenge-schema.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/curriculum/schema/challenge-schema.js b/curriculum/schema/challenge-schema.js index 2d9805c6550..a2b49baa36d 100644 --- a/curriculum/schema/challenge-schema.js +++ b/curriculum/schema/challenge-schema.js @@ -209,7 +209,11 @@ const schema = Joi.object() }), forumTopicId: Joi.number(), id: Joi.objectId().required(), - instructions: Joi.string().allow(''), + instructions: Joi.string().when('challengeType', { + is: [challengeTypes.pythonProject, challengeTypes.codeAllyCert], + then: Joi.string().min(1).required(), + otherwise: Joi.string().allow('') + }), isComingSoon: Joi.bool(), isLocked: Joi.bool(), isPrivate: Joi.bool(),