A Yii2 extension that provides JSON validation
$ composer require romi45/yii2-json-validator ~1.1
<?php
namespace app\models;
use yii\base\Model;
use romi45\yii2jsonvalidator\JsonValidator;
class Foo extends Model
{
public $bar;
public function rules()
{
return [['bar', JsonValidator::class]];
}
}
View public properties in class JsonValidator to get info about all available options.