league/json-reference
A PHP library for resolving JSON References, including JSON Pointers ($ref) in JSON documents and schemas. It dereferences local and remote references through a simple API, with support for custom retrievers and integration with JSON Schema tooling.
$ref resolution. Any product that ingests JSON Schema (draft-04 and earlier) or OpenAPI/Swagger 2.0 documents eventually needs a resolver: follow a $ref, resolve it relative to the correct base URI, guard against circular references. That algorithm is deceptively fiddly. This package is a ready-made, MIT-licensed implementation, so "adopt a resolver" becomes a legitimate option instead of spending a sprint or two on one.Consider it when:
$ref and JSON Pointers against draft-04-era JSON Schema or Swagger 2.0, including multi-file documents and id-based base-URI scoping.Look elsewhere when:
To executives: A small, free, MIT-licensed PHP component that saves us from hand-writing one of the more error-prone pieces of API tooling — following and resolving schema references. It is not a platform investment: the project is archived, has effectively no user base, and will never receive another update. The right framing is "a reference implementation we can lift from and own," not "a dependency we adopt." Cost to adopt is near zero; cost to own is a fork we maintain ourselves. Recommend it only inside internal, time-boxed work, and only if engineering agrees to own the code.
To engineering: Treat this as source material, not a dependency. The valuable asset is the resolution logic — base-URI scoping, pointer traversal, circular-reference handling — which is genuinely tedious to get right and cheap to copy under MIT. Before adopting, confirm three things: (1) does our existing validator already resolve references, making this redundant; (2) does our target spec version actually match its draft-04-era model; (3) who owns the fork when a PHP upgrade breaks it. If the answer to (3) is "nobody," vendor the algorithm into our own codebase instead of adding a package manager entry — same benefit, no orphaned dependency, and no false expectation of upstream fixes.
How can I help you explore Laravel packages today?