2017 © Pedro Peláez
 

library json-reference

A library for working with JSON References

image

activerules/json-reference

A library for working with JSON References

  • Tuesday, February 20, 2018
  • by bwinkers
  • Repository
  • 1 Watchers
  • 0 Stars
  • 434 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

JSON Reference

![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Documentation][ico-docs], (*1)

NOTE:

This was forked from the referencer written by The PHP League., (*2)

Our only change is to support "psuedo-relative" paths., (*3)

Example:, (*4)

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

The psuedo-relative paths are resolved relative to a defined root directory., (*5)

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., (*6)

The Basics

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

JSON Reference is a library for resolving references., (*8)

  • 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

Via Composer

composer require activerules/json-reference

Usage

Our changes shouldn't change the behavior of the dereferenced files so all of the original documentation should be applicable., (*9)

Complete documentation is available here., (*10)

Change log

Please see CHANGELOG for more information about what has changed recently., (*11)

Testing

``` bash $ composer test-server $ composer test, (*12)


## Benchmarks The benchmarks require a local redis server to be running on localhost at the default port. ```bash $ composer bench

Contributing

Please see CONTRIBUTING for details., (*13)

Security

If you discover any security related issues, please email bwinkers@gmail.com instead of using the issue tracker., (*14)

Credits

License

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

UltriNet, (*16)

The Versions

20/02 2018

dev-master

9999999-dev

A library for working with JSON References

  Sources   Download

MIT

The Requires

 

The Development Requires

json path local reference ref json-reference relative psuedo-relative

23/11 2017

1.1.1

1.1.1.0

A library for working with JSON References

  Sources   Download

MIT

The Requires

 

The Development Requires

json path local reference ref json-reference relative psuedo-relative

23/11 2017

1.0.2

1.0.2.0

A library for working with JSON References

  Sources   Download

MIT

The Requires

 

The Development Requires

json path local reference ref json-reference relative psuedo-relative

23/11 2017

1.1.0

1.1.0.0

A library for working with JSON References

  Sources   Download

MIT

The Requires

 

The Development Requires

json path local reference ref json-reference relative psuedo-relative

24/04 2017