Draft: feat: #3585354 add content-entity-types / fields endpoints for entity reference selection UI

Adds two read-only HTTP endpoints that an entity-reference selection UI (the postponed [#3585355]) will consume:

  • GET /canvas/api/v0/ui/entity-reference/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 /canvas/api/v0/ui/entity-reference/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. Every hop in a ?parent= chain is also access-checked.

Image, file, link, and entity references targeting a Media bundle with a known source (Image, VideoFile) surface as a single object expression rather than an expandable reference — mirroring ShapeMatchingHooks::getObjectProps(). The per-field-type editorial knowledge has been extracted into a new FieldExpressionDeriver service so it isn't duplicated.

AI-Generated: Yes (Used Claude (Opus 4.7) to create plan / code).

Testing instructions

Closes #3585354

Edited by Christian López Espínola

Merge request reports

Loading