Uploaded image for project: 'Repository'
  1. Repository
  2. REPO-161

Improve REST fwk - select takes precedence over properties (hence selected members should not be trimmed)

    Details

      Description

      Logged as a placeholder, pending agreement on difference between select & properties (and related).

      In summary, as of now, for entities and collections of entities (at least):

      • "properties" provides structural filtering of the response to reduce the amount of data returned over the wire (if desired by clients, eg. mobile).
      • "select" provides the ability to add ('expand') more information beyond the basic response. This information usually requires additional lookup.

      It has been noted, that rather than having to repeat everything in the "select" in the "properties", it should be included automatically. In other words, "select" takes precedence over "properties.

      Here's a contrived example. Instead of specifying:

      GET /nodes/my/children?select=aspectNames,properties,isLink,path&properties=id,name,aspectNames,properties,isLink,path

      It should be possible to improve the REST fwk such that we can simply specify:

      GET /nodes/my/children?select=aspectNames,properties,isLink,path&properties=id,name

      ---------------

      Caveat: The "properties" clause currently only applies to the top-level members. Hence, if "select"ing a single property and using "properties, it is necessary to fully qualify the "select". This should be logged as a separate/related enhancement request.

      In other words. This will not return the property (unless "properties" clause is omitted):

      GET /nodes/my/children?select=cm:lastThumbnailModification&properties=id,name

      This will work as expected:

      GET /nodes/my/children?select=properties/cm:lastThumbnailModification&properties=id,name

      {
        "list": {
          "pagination": {
            "count": 4,
            "hasMoreItems": false,
            "totalItems": 4,
            "skipCount": 0,
            "maxItems": 100
          },
          "entries": [
            {
              "entry": {
                "name": "Folder x",
                "id": "6f39c96c-d3f2-406d-8ee7-92d9ab1f283a"
              }
            },
            {
              "entry": {
                "name": "Ano1",
                "id": "8cc67e57-e778-415a-88fb-8da52a4dd073"
              }
            },
            {
              "entry": {
                "name": "picture.jpg",
                "id": "d019b383-63b6-49fe-ab9e-acea994748a9",
                "properties": {
                  "cm:lastThumbnailModification": [
                    "doclib:1452015007512",
                    "imgpreview:1452015010955"
                  ]
                }
              }
            },
            {
              "entry": {
                "name": "Important.pdf",
                "id": "32ea6cb1-f6a2-4f61-aa6b-91fbf8dc8919",
                "properties": {
                  "cm:lastThumbnailModification": [
                    "doclib:1452010584486"
                  ]
                }
              }
            },
            {
              "entry": {
                "name": "Backup folder",
                "id": "34003fd9-8cc5-490d-a844-bf29d312fe44"
              }
            }
          ]
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jvonka Jan Vonka
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: