diff --git a/src/DB.php b/src/DB.php index 12a6aa0..29d85ca 100644 --- a/src/DB.php +++ b/src/DB.php @@ -524,6 +524,11 @@ public function validatePayload(array $payload, array $tableInfo): array if ($info) { if (gettype($value) !== $info['type']) { + + if(is_array($value) || is_object($value)){ + $value = str_replace([':','{','}'],["=>",'[',']'],json_encode($value)); + } + throw new DataValidatorException("Error Processing Data, type given for key '$col' not respect datatype column in database table, type must be an {$info['type']} at '$value (" . gettype($value) . ")'", 1); }