I'm trying to validate that an input is valid json. However it returns success for "123" as input. This does not seem to be valid or at least is not valid in terms of what i need.
Do you know a way to improve the validation for json input?
public function rules()
{
switch($this->method()) {
case "GET":
return [];
case "DELETE":
return [];
default:
return [
'name' => 'required',
'templatestring' => 'required|JSON'
];
}
}