Function: parseResources()
parseResources(
__namedParameters):ApiResource[]
Defined in: core/resources.ts:409
Reads the spec as a set of REST resources, the way an admin UI needs it:
operations are grouped by tag (untagged ones by their first path segment
after api/v1; a tag holding several collections is split by them), and
each takes a role from its method and path shape —
GET /clients lists, POST /clients creates, GET/PATCH/DELETE /clients/{client_id} read, update and delete one record, and any other
write becomes an action. The spec carries no UI instructions; the roles are
conventions.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | object & ParseResourcesOptions |
Returns
Example
parseResources({ spec })[0]; // { key: 'clients', list: …, create: …, actions: [] }