improve input validation for objects and object arrays

pls change to number castable string like '1' as this is the cause of this issue