PHPackages                             league/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. league/json-reference

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

league/json-reference
=====================

A library for working with JSON References

1.1.0(8y ago)32847.4k↓58.6%9[5 issues](https://github.com/thephpleague/json-reference/issues)12MITPHPPHP &gt;=5.6.0

Since Apr 24Pushed 8y agoCompare

[ Source](https://github.com/thephpleague/json-reference)[ Packagist](https://packagist.org/packages/league/json-reference)[ RSS](/packages/league-json-reference/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (11)Versions (4)Used By (12)

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

[](#json-reference)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0f243f7580df7cb5b05751bd1c76b7053d4c474b5a0e7e314c01c8c5b4a3721a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f6a736f6e2d7265666572656e63652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thephpleague/json-reference)[![Coverage Status](https://camo.githubusercontent.com/ebfa81dabad98c01e2a68914b87c1f365a1f4dbb13f1eea8e9bebdaaf5153042/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7468657068706c65616775652f6a736f6e2d7265666572656e63652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/json-reference/code-structure)[![Quality Score](https://camo.githubusercontent.com/0b2d42114d4875ca56ea9e771a70ea9398e56c1a8bba2b38e47bff9792384a8d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f6a736f6e2d7265666572656e63652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/json-reference)[![Documentation](https://camo.githubusercontent.com/16ee0df28d58259503825d407ff718c07112b5f956409840668d1efc7ddce4ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63732d4c61746573742d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://json-reference.thephpleague.com/)

Unmaintained!
=============

[](#unmaintained)

This project is no longer maintained. Recommended alternatives:

- [opis/json-schema](https://github.com/opis/json-schema)
- [swaggest/php-json-schema](https://github.com/swaggest/php-json-schema)

---

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 league/json-reference
```

Usage
-----

[](#usage)

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/thephpleague)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~167 days

Total

3

Last Release

3023d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9440455?v=4)[Matt A](/maintainers/matt-allan)[@matt-allan](https://github.com/matt-allan)

---

Top Contributors

[![peterpostmann](https://avatars.githubusercontent.com/u/9541377?v=4)](https://github.com/peterpostmann "peterpostmann (3 commits)")[![mark-lambley-simpro](https://avatars.githubusercontent.com/u/24515999?v=4)](https://github.com/mark-lambley-simpro "mark-lambley-simpro (1 commits)")[![natebrunette](https://avatars.githubusercontent.com/u/1831497?v=4)](https://github.com/natebrunette "natebrunette (1 commits)")

---

Tags

jsonReferencejson-reference

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k334.7M790](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k504.8M167](/packages/mtdowling-jmespathphp)[jms/serializer

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

2.3k141.9M929](/packages/jms-serializer)[jms/serializer-bundle

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

1.8k92.4M680](/packages/jms-serializer-bundle)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30525.1M57](/packages/colinodell-json5)

PHPackages © 2026

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