2017 © Pedro Peláez
 

yii2-extension yii2-json-schema-validator

A Yii2 extension that provides a validator class for JSON Schema validation.

image

dstotijn/yii2-json-schema-validator

A Yii2 extension that provides a validator class for JSON Schema validation.

  • Monday, August 29, 2016
  • by dstotijn
  • Repository
  • 1 Watchers
  • 15 Stars
  • 2,274 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Yii 2 JSON Schema Validator

Build Status Code Coverage, (*1)

A Yii 2 extension that provides a validation class that wraps JSON Schema for PHP., (*2)

Installation

$ composer require dstotijn/yii2-json-schema-validator

Usage

Model class example:, (*3)

<?php

namespace app\models;

use dstotijn\yii2jsv\JsonSchemaValidator;
use Yii;
use yii\base\Model;

class YourCustomModel extends Model
{
    public $json;

    public function rules()
    {
        return [
            [
                'json',
                JsonSchemaValidator::className(),
                'schema' => 'file://' . Yii::getAlias('@app/path/to/schema.json'),
                /* or URL
                'schema' => 'https://example.com/path/to/schema.json',
                */
            ],
        ];
    }
}

See json-schema for details how to describe JSON schema., (*4)

Please view public properties in class JsonSchemaValidator to get info about all available options., (*5)

The Versions

29/08 2016

dev-master

9999999-dev

A Yii2 extension that provides a validator class for JSON Schema validation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by David Stotijn

schema json yii2 validator

13/07 2016

1.0.0

1.0.0.0

A Yii2 extension that provides a validator class for JSON Schema validation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by David Stotijn

schema json yii2 validator