Per-field editing contract for Content Fragments in the Universal Editor
Problem: the OOTB Content Fragment component makes every field of a referenced fragment editable in the Universal Editor. There's no supported way to expose some fields (title, body) while protecting others (slug, featured image, metadata owned by other teams). This is the default behaviour, not an edge case.
I went down a deep rabbit hole and tried several approaches:
The Field Contract Pattern worked: A proxy component whose editables point at the component's own node (so the rail resolves a model I control, not the CF schema), reading the fragment live for display and writing approved fields back via a ResourceChangeListener. Hidden fields simply aren't editables anywhere — enforcement by construction.
Full writeup with code: Selective Content Fragment Editing in AEM Universal Editor: Building a Field-Level Editing Contract
Open question for the community and Adobe: is there a supported way to scope the CF schema returned to /details per editing context, or a cancellable pre-persist extension hook? If not, would either be on the roadmap? Keen to hear if anyone's solved this more cleanly.