API / Minn\Rest / IndexController

IndexController final readonly class

Minn\Rest\IndexController · public/minn/src/Minn/Rest/IndexController.php · 56 lines

The API index at /wp-json/: the site facts monitors read (name, url, home, namespaces) and the routes this engine serves, described from its own router rather than the reference's full schema; and the index of one namespace at /wp-json/{namespace}, the same routes narrowed.

Used by 1

Constants and properties

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Rest\RestUrl $url

Promoted from the constructor.

privatereadonly Minn\Rest\RouteCatalogue $catalogue

Promoted from the constructor.

Public

new__construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Rest\RestUrl $url, Minn\Rest\RouteCatalogue $catalogue)#
methodindex(Minn\Http\Request $request): Minn\Http\ResponseGET / (public)#

The REST index: namespaces, routes, and the site's description.

methodnamespaceIndex(Minn\Http\Request $request, string $namespace): Minn\Http\ResponseGET /{namespace:[a-z0-9-]+/(?:v\d+|\d+\.\d+)} (public)#

One namespace's index, as the reference answers /wp-json/wp/v2 (or oembed/1.0): the namespace, its routes (the namespace root among them), and the link up to the root index. A namespace the engine does not serve is left to the runtime, whose plugins may own it.