lib: refactor to use validateObject()
validator
#41845
Merged
validateObject()
validator
#41845