Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-99361

Add more context to NestedFields so it can retrieve nested objects based on the parent object

    Details

      Description

      I have two objects with the same nestedField:

      Accounts
      	Contacts
      
      Projects
      	Contacts
      

      In my @NestedFields annotation, I would need a different value for each

      @NestedField("AccountContacts")
      public Page<Contact> getAccountAccountKeyContactsPage(

      @NestedField("ProjectContacts")
      public Page<Contact> getProjectProjectKeyContactsPage(

      As a client I would expect that the nestedField would be the same when calling the API. For example:
      curl http://localhost:7280/o/rest/v1.0/accounts/abc?nestedFields=contacts
      curl http://localhost:7280/o/rest/v1.0/projects/def?nestedFields=contacts

      For the solution I was thinking maybe something like this?
      @NestedField(class="com.liferay.Account", value="contact")

        Attachments

          Activity

            People

            Assignee:
            ivica.cardic Ivica Cardic
            Reporter:
            amos.fong Amos Fong
            Engineering Assignee:
            Ivica Cardic
            Recent user:
            Kiyoshi Lee
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.1.X
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                Master