Add "Typed Data browser" internal HTTP API for `content-entity-reference` props' selection UI — single-target-bundle references only
> [!note] Migrated issue > > <!--Drupal.org comment--> > > <!--Migrated from issue #3585354.--> > > Reported by: [penyaskito](https://www.drupal.org/user/959536) > > Related to !1112 ### Overview To configure a JS component's content-entity-reference dependencies, an editor needs to pick a target entity type and bundle and then choose which of its fields the component should bind to. Two pieces of information are missing from the Canvas HTTP API today: 1. The fieldable content entity types and bundles available on the site, filtered to those the current user can view. 2. The fields on a given entity type and bundle that can drive a JS component prop, with pre-built expression strings — including navigation through reference fields. Existing endpoints under `/canvas/api/v0/ui/content_template/suggestions/*` are coupled to a specific Component config entity and cannot serve a generic editor configuring content-entity-reference dependencies. This issue unblocks the UI work tracked in [<span dir="">#3585355: \[PP-1\] Entity Reference Selection UI</span>](https://www.drupal.org/project/canvas/issues/3585355 "Status: Postponed"). ### Proposed resolution Add two read-only endpoints under `/canvas/api/v0/ui/entity-reference/*`: * `GET …/content-entity-types` — fieldable content entity types and their bundles, filtered by per-bundle view access. Bundle-less entity types are surfaced with a single self-named bundle. * `GET …/fields/{entity_type}/{bundle}` — field descriptors with pre-built expression strings. An optional `?parent=[expression]` chains the response to a reference path so the UI can lazily expand reference fields without constructing expressions itself. Per-bundle and per-field view access checks run against an unsaved stub entity so internal fields (e.g. the user `pass` hash) are not surfaced to editors who can't read them. Every hop in a `?parent=` reference chain is also access-checked. Both endpoints are documented in `openapi.yml` and validated at runtime by `ApiResponseValidator`. **It MUST stay true to `docs/adr/0005-Keep-the-front-end-simple.md`.** ### User interface changes None in this issue. The editor UI consuming these endpoints is tracked in [<span dir="">#3585355: \[PP-1\] Entity Reference Selection UI</span>](https://www.drupal.org/project/canvas/issues/3585355 "Status: Postponed"). ### API changes * Added: `GET /canvas/api/v0/ui/entity-reference/content-entity-types` * Added: `GET /canvas/api/v0/ui/entity-reference/fields/{entity_type}/{bundle}` ### Data model changes None. > Related issue: [Issue #3585355](https://www.drupal.org/node/3585355) > Related issue: [Issue #3573831](https://www.drupal.org/node/3573831)
issue