An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, $ref fields MUST be used in the specification to reference those parts as follows from the JSON Schema definitions.
This package is part of oas-php project and is used internally by oas-php/document
to resolve $ref's
. However, it's not confined just to OAS. In fact, it might be used with any document which uses JSON References.
The oas-php/resolver
is a composer package. Install it by running:
composer req oas-php/resolver
The package dependency list is short as possible. However, I suggest installing a few optional packages, so you don't need to configure anything yourself.
If you install suggested packages, the simplest use case may look like:
$resolved = (new Resolver)->resolve('https://oas-php.github.io/sample/theater/openapi.json');
See documentation to learn more.
MIT