sanitize json_get_type function