PHPackages                             activerules/json-reference - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. activerules/json-reference

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

activerules/json-reference
==========================

A library for working with JSON References

1.1.1(8y ago)045811MITPHPPHP &gt;=5.6.0

Since Apr 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ActiveRules/json-reference)[ Packagist](https://packagist.org/packages/activerules/json-reference)[ RSS](/packages/activerules-json-reference/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (9)Versions (6)Used By (1)

JSON Reference
==============

[](#json-reference)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ebe58f07e480f99e0397d51bca2aeddbe1aae3d710762aec0b709db4dda167fa/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6277696e6b6572732f6a736f6e2d7265666572656e63652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/bwinkers/json-reference)[![Coverage Status](https://camo.githubusercontent.com/54cbe9c2031dd81755fb8ce95862e064b0143822d7cec567e483fec95b53a7ff/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6277696e6b6572732f6a736f6e2d7265666572656e63652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bwinkers/json-reference/code-structure)[![Quality Score](https://camo.githubusercontent.com/695bd39b03223dd8ecefe3eb4577f2a2cf7e5a1d163efd6e36f7064b6f2dda1f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6277696e6b6572732f6a736f6e2d7265666572656e63652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bwinkers/json-reference)[![Documentation](https://camo.githubusercontent.com/16ee0df28d58259503825d407ff718c07112b5f956409840668d1efc7ddce4ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63732d4c61746573742d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://json-reference.thephpleague.com/)

NOTE:
-----

[](#note)

This was forked from the referencer written by The PHP League.

Our only change is to support "psuedo-relative" paths.

Example:

```
{ "$ref": "file://./address.json" }

```

The psuedo-relative paths are resolved relative to a defined root directory.

That root directory is defined by the `AR_JSON_SCHEMA_DIR` ENV variable. If that is NOT defined the code uses a `schema` directory relative to the current working directory as the root.

The Basics
----------

[](#the-basics)

Most JSON schemas use JSON references to minimize duplication. A JSON reference is an object that looks like {"$ref": "[http://some/where"}](http://some/where%22%7D) and points to a JSON object somewhere else.

JSON Reference is a library for resolving references.

- Resolves all references, replacing them with proxy objects.
- Supports references to external files, urls, or custom sources.
- Safely resolves circular references.
- Supports caching dereferenced schemas.
- Dereferenced schemas can be safely json\_encoded.
- Works with Swagger, JSON Schema, and any other spec compliant JSON documents.

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
composer require activerules/json-reference
```

Usage
-----

[](#usage)

Our changes shouldn't change the behavior of the dereferenced files so all of the original documentation should be applicable.

Complete documentation is available [here](http://json-reference.thephpleague.com/).

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information about what has changed recently.

Testing
-------

[](#testing)

```
$ composer test-server
$ composer test
```

Benchmarks
----------

[](#benchmarks)

The benchmarks require a local redis server to be running on localhost at the default port.

```
$ composer bench
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Matt Allan](https://github.com/ActiveRules)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Sponsored By:
-------------

[](#sponsored-by)

[UltriNet](http://www.ultri.net)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

5

Last Release

3094d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebdbe4d0451d5b30c19c1eb4373de5946fb5c04511f7f45f441824126284b061?d=identicon)[bwinkers](/maintainers/bwinkers)

---

Top Contributors

[![bwinkers](https://avatars.githubusercontent.com/u/4514677?v=4)](https://github.com/bwinkers "bwinkers (11 commits)")[![natebrunette](https://avatars.githubusercontent.com/u/1831497?v=4)](https://github.com/natebrunette "natebrunette (1 commits)")

---

Tags

jsonpathrelativelocalReferencejson-referencerefpsuedo-relative

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/activerules-json-reference/health.svg)

```
[![Health](https://phpackages.com/badges/activerules-json-reference/health.svg)](https://phpackages.com/packages/activerules-json-reference)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M612](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[galbar/jsonpath

JSONPath implementation for querying and updating JSON objects

2136.4M78](/packages/galbar-jsonpath)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30422.2M45](/packages/colinodell-json5)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
