Repository navigation
[SPIKE] Implement Open Folder Endpoint #33242
Description
Task Title
Implement Open Folder Endpoint
Description
We need a new endpoint called Open Folder.
The purpose is to retrieve all immediate child folders of a given folder path.
• Input: a folder path (passed in the request body, not in the URL).
• Output: a list of folders that are direct children of the folder in that path.
• No recursive/deep traversal is needed.
• No assets should be included in the response (only folders).
This endpoint will simplify and speed up the construction of folder paths by reducing the number of requests needed.
Acceptance Criteria
Must use POST for passing the path (never in the URL).
• Request body should contain:
• siteName (string)
• path (string)
• Return only the first-level children folders inside the given folder.
• Exclude assets and deeper descendant folders.
• Response should include folder metadata (e.g., identifier, name, title, path).
• Endpoint must be POST only (no GET, no query params).
• Request body includes siteName and path.
• Returns only folders (no assets).
• Returns only immediate children, no nested traversal.
• Includes folder metadata (identifier, name, title, path).
• Returns an empty list if the folder has no child folders.
• Returns a 404 if the folder/path does not exist.
Priority
Medium
Additional Context
Example Request:
POST /api/open-folder
Content-Type: application/json
{
"siteName": "demo.dotcms.com",
"path": "/assets"
}
Example Response:
{
"entity": {
"identifier": "folder123",
"title": "Images",
"name": "images",
"path": "/assets/images",
"hasChildren": true,
"modDate": "2025-05-25T12:00:00Z",
"allowedExtensions": ["jpg", "png"],
"subFolders": [
{
"identifier": "subfolder1",
"title": "Products",
"name": "products",
"path": "/assets/images/products",
"hasChildren": false,
"modDate": "2025-05-24T10:00:00Z",
"allowedExtensions": ["jpg", "png"],
},
{
"identifier": "subfolder2",
"title": "Banners",
"name": "banners",
"path": "/assets/images/banners",
"hasChildren": true,
"modDate": "2025-05-23T15:30:00Z",
"allowedExtensions": ["jpg", "png"],
}
]
},
"errors": [],
"messages": [],
"i18nMessagesMap": {},
"permissions": ["READ", "WRITE"],
"pagination": null
}
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
jdotcms commentedon Sep 10, 2025
isnt the BrowserResource such as this?
fabrizzio-dotCMS commentedon Sep 11, 2025
Perhaps it does. Looks like this might:
need to investigate if this one does what we want.
Thanks @jdotcms
fabrizzio-dotCMS commentedon Sep 16, 2025
After a quick research of both BrowserResource and FolderResource, I corroborate that we don't have an endpoint that fulfills what we want to accomplish here, as described in the requirements
Here's a new explanation of what we want to accomplish that does not currently exist :
We need to adjust the behavior of the new Open Folder endpoint.
Given a path such as:
//site/f1/f2/f3/the endpoint should return only the immediate child folders of each folder included in the path.
In the above example, the response must include:
• The direct children of f1
• The direct children of f2
• The direct children of f3
This means that the endpoint should not traverse recursively beyond one level of depth per folder in the given path.
Assuming a request like: //site/f1/f2/f3/
The expected response must include only first-level sibiling folders within the path, like this:
[-][TASK] Implement Open Folder Endpoint[/-][+][SPIKE] Implement Open Folder Endpoint[/+]