Issue #3617555: Describe the response body of each resource

All 42 resources now implement getOpenapiResponseSchema(); one did before. Every top-level key of every response is named and typed, group by group: the node and taxonomy term detail resources, the listings, the page resources, the submission endpoints and the file resources.

The shapes the structure builders return are described once, in src/Openapi/MyrestSchema.php - image, menu, breadcrumbs, facets, price rows, counters, dynamic_data, and the doctor, review, discount, package, before-and-after, blog, article, news and page bodies. listing() builds a paginated response around any item schema, including the redirect a listing sends instead of a page past the end of the result set, which was documented nowhere.

Where the payload is decided by the site - a paragraph type, a facet, a field on a bundle - the property is an object with text saying what decides its keys, rather than one site's content model presented as the API.

A kernel test fails if any resource of the module does not describe its body, and the functional suites compare the keys of the real response against the schema of the resource that sent it.

Also fixed: the 200 schema went to the operation unwrapped while the error schemas went through wrapOpenapiSchema(), so on a site with the response envelope on the success shape was documented flat and the errors enveloped. The generator wraps both now.

Closes #3617555

Merge request reports

Loading
Loading