The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Getting Started

Circular References

This library fully supports recursive references. Consider the following example:

  "author": {
    "properties": {
        "name": {
          "type": "string"
        "co-author": {
            "$ref": "#/author" // circular reference


If the dereferencer attempted to fully resolve this reference, the dereferencer would continue looping infintely. Instead of resolving references immediately, the $ref is replaced with a lazy proxy object. The reference is only resolved when it’s accessed.

Because circular object references are possible, make sure your code accessing the dereferenced object does not get stuck in an infinite loop!