oas-php/resolver

JSON Reference resolver

v0.1.3 2022-12-08 21:17 UTC

This package is auto-updated.

Last update: 2024-04-09 00:32:02 UTC


README

JSON Reference resolver

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.

installation

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.

usage

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.

license

MIT