From 6c748d9c4208a591aa629381fe4a97223503feb6 Mon Sep 17 00:00:00 2001 From: JeelRajodiya Date: Sun, 25 Aug 2024 16:07:47 +0530 Subject: [PATCH] chore: add properties in the required field closes #62 --- content/05-Conditional-Validation/04-if-then-else/code.ts | 2 +- .../05-Conditional-Validation/04-if-then-else/instructions.mdx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content/05-Conditional-Validation/04-if-then-else/code.ts b/content/05-Conditional-Validation/04-if-then-else/code.ts index ef6c04c..dba2bf7 100644 --- a/content/05-Conditional-Validation/04-if-then-else/code.ts +++ b/content/05-Conditional-Validation/04-if-then-else/code.ts @@ -17,7 +17,7 @@ const code: any = { }, }, - required: ["name"], + required: ["name", "isStudent"], }; let solution = structuredClone(code); diff --git a/content/05-Conditional-Validation/04-if-then-else/instructions.mdx b/content/05-Conditional-Validation/04-if-then-else/instructions.mdx index c71a88f..a50186f 100644 --- a/content/05-Conditional-Validation/04-if-then-else/instructions.mdx +++ b/content/05-Conditional-Validation/04-if-then-else/instructions.mdx @@ -35,7 +35,8 @@ You can use the `if-then-else` [keyword](https://json-schema.org/learn/glossary# }, "if": {"properties": {"isFullTime": {"const": true}}}, "then": {"required": ["salary"]}, - "else": {"required": ["hourlyRate"] } + "else": {"required": ["hourlyRate"] }, + "required": ["isFullTime"] } ```