HI Team, I am trying to get the below Json format "RegistrationNumber": { "type": "string", "when": { "SearchRegoOrManual": { "is": "RegistrationNumber", "then": { "required": true } }, }, } by using yup.string().when("SearchRegoOrManual", {is: "RegistrationNumber". then : yup.number().required() }) but in the output we are getting the expected output. Please help