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

Support listing of secondary children

    Details

      Description

      Summary Notes

      This is an alternative to using /nodes/{parentId}/children but in this case only lists secondary children (not primary children).

      GET /nodes/{parentId}/secondary-children [ ?where=(assocType='my:assocType') ]

      Acceptance Criteria

        '/nodes/{parentId}/secondary-children':
          get:
            tags:
              - child associations
              - 5.2 changes
            summary: List secondary children
            description: |
              Returns a list of secondary child nodes that are associated with the current parent node, via a secondary child association.
            operationId: listSecondaryChildAssociations
            produces:
              - application/json
            parameters:
              - name: parentId
                in: path
                description: The identifier of a node.
                required: true
                type: string
              - name: assocType
                in: query
                description: Restrict the returned results to only those of the given association type
                type: string
                required: false 
              - name: where
                in: query
                description: |
                  Optionally filter the list by assocType. Here's an example:
      
                  *   where=(assocType='my:assoctype')
                required: false
                type: string          
              - $ref: '#/parameters/nodeAssocMinimalEntryIncludeParam'
              - $ref: '#/parameters/fieldsParam'
            responses:
              '200':
                description: Successful response
                schema:
                  $ref: '#/definitions/NodeChildAssocPaging'
              '400':
                description: Invalid parameter, eg. unknown assocType
              '404':
                description: If **parentId** does not exist
              default:
                description: Error response
                schema:
                  $ref: '#/definitions/Error'
      definitions:
      NodeChildAssocPaging:
          type: object
          properties:
            list:
              type: object
              properties:
                pagination:
                  $ref: '#/definitions/Pagination'
                entries:
                  type: array
                  items:
                    $ref: '#/definitions/NodeChildAssocMinimalEntry'
        NodeChildAssocMinimalEntry:
          type: object
          required:
            - entry
          properties:
            entry:
              $ref: '#/definitions/NodeChildAssocMinimal'
        NodeChildAssocMinimal:
          type: object
          properties:
            id:
              type: string
            parentId:
              type: string
            name:
              type: string
            nodeType:
              type: string
            isFolder:
              type: boolean
            isFile:
              type: boolean
            modifiedAt:
              type: string
              format: date-time
            modifiedByUser:
              $ref: '#/definitions/UserInfo'
            createdAt:
              type: string
              format: date-time
            createdByUser:
              $ref: '#/definitions/UserInfo'
            content:
              $ref: '#/definitions/ContentInfo'
            association:
              $ref: '#/definitions/ChildAssocInfo'
        ChildAssocInfo:
          type: object
          properties:
            assocType:
              type: string 
            isPrimary:
              type: boolean
      

      Note: isPrimary will always be false here (since we're only listing secondary children)

      Notes

      • it should be noted that "/secondary-children" could return more results that "/children?where=(isPrimary=false)" since the latter does not currently return the same child more than once (even if it has two or more secondary child association of different types). We may wish to change /children in the future although likely still an option to avoid name clash issues when being used for File/Folder scenarios

      For live API spec, please see:

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gcornwell Gavin Cornwell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: