fix(utils): fix validation for required values without specified type (#9863)

Refs #8007
This commit is contained in:
Oliwia Rogala
2024-04-23 10:09:32 +02:00
committed by GitHub
parent cf7b7691f5
commit 6fccf9e219
2 changed files with 30 additions and 1 deletions

View File

@@ -1037,6 +1037,22 @@ describe("utils", () => {
value = 10
assertValidateParam(param, value, [])
})
it("validates required parameters without schema", () => {
// valid value
param = {
required: true
}
value = 123
assertValidateParam(param, value, [])
// missing value
param = {
required: true
}
value = undefined
assertValidateParam(param, value, ["Required field is not provided"])
})
})
describe("fromJSOrdered", () => {