PHP code example of soyuka / json-schema-bundle

1. Go to this page and download the library: Download soyuka/json-schema-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

soyuka / json-schema-bundle example snippets



// app/AppKernel.php

use Soyuka\JsonSchemaBundle\JsonSchemaBundle;

public function registerBundles()
{
    $bundles = array(
        // ...
        new JsonSchemaBundle(),
    );
}


use Soyuka\JsonSchemaBundle\Constraints as JsonSchemaAssert;

/**
 * @JsonSchemaAssert\JsonSchema
 */
class DefaultJsonSchema
{
}


use Soyuka\JsonSchemaBundle\Constraints as JsonSchemaAssert;

/**
 * @JsonSchemaAssert\JsonSchema(schema = "validators/specific.json")
 */
class SpecificJsonSchema
{
}