[MGNLREST-328] JcrReferenceResolverDefinition to allow specify properties to resolve Created: 26/Aug/21  Updated: 11/Jan/24

Status: Open
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Bartosz Staryga Assignee: Unassigned
Resolution: Unresolved Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLREST-329 ReferenceResolver should provide acce... Accepted
relation
is related to MGNLREST-224 Specify fields to return Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

Consider following:

Page tree

home
  |_child-1
    |_sub-child-2

home page dialog property

pageLink:
  $type: pageLinkField

rest

class: info.magnolia.rest.delivery.jcr.v2.JcrDeliveryEndpointDefinition
workspace: website

references:
  - name: pageLink
    propertyName: pageLink
    referenceResolver:
      class: info.magnolia.rest.reference.jcr.JcrReferenceResolverDefinition
      targetWorkspace: website

When on home I link pageLink to child-1 and all rest for home I will get whole pageLink resolved including all sub nodes - sub-child-2.

In this scenraio I want only child-1 as I want it's e.g. path.

It would be nice If I could specify on resolver reference properties which I want to be resolved.

E.g.

references:
  - name: pageLink
    propertyName: pageLink
    referenceResolver:
      class: info.magnolia.rest.reference.jcr.JcrReferenceResolverDefinition
      targetWorkspace: website
      properties:
        - @path
        - title

Generated at Mon Feb 12 06:58:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.