Skip to content

An experimental caching decorator for league/json-guard.

License

Notifications You must be signed in to change notification settings

mikefaut/json-guard-cached

Repository files navigation

JSON Guard Cached

A json-guard decorator to enable schema caching. Works with any PSR-6 cache implementation.

This decorator is experimental until it proves to be worth using.

Install

Via Composer

$ composer require yuloh/json-guard-cached

Usage

use Cache\Adapter\Redis\RedisCachePool;
use League\JsonGuard\Dereferencer;
use League\JsonGuard\Cached\CachedDereferencer;

$client = new Redis();
$client->connect('127.0.0.1', 6379);
$cache = new RedisCachePool($client);

$deref = new Dereferencer();
$deref = new CachedDereferencer($cache, $deref);

$schema = $deref->dereference('file://my-schema.json');

Testing

$ composer test

License

The MIT License (MIT). Please see License File for more information.

About

An experimental caching decorator for league/json-guard.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages