-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample-data.json
More file actions
106 lines (106 loc) · 2.7 KB
/
sample-data.json
File metadata and controls
106 lines (106 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
"initialData": [
{
"id": 1,
"name": "src",
"type": "folder",
"parentId": null
},
{
"id": 2,
"name": "components",
"type": "folder",
"parentId": 1
},
{
"id": 3,
"name": "Navbar.js",
"type": "file",
"size": 3,
"parentId": 2
},
{
"id": 4,
"name": "App.js",
"type": "file",
"size": 2,
"parentId": 1
}
],
"testCases": {
"createFolder": {
"description": "Create a new folder at root level",
"method": "POST",
"url": "/api/node",
"body": {
"name": "public",
"type": "folder",
"parentId": null
},
"expectedStatus": 201
},
"createFile": {
"description": "Create a new file inside a folder",
"method": "POST",
"url": "/api/node",
"body": {
"name": "index.html",
"type": "file",
"size": 1500,
"parentId": 1
},
"expectedStatus": 201
},
"createFileAtRoot": {
"description": "Try to create a file at root (should fail)",
"method": "POST",
"url": "/api/node",
"body": {
"name": "test.js",
"type": "file",
"size": 100,
"parentId": null
},
"expectedStatus": 400
},
"moveFile": {
"description": "Move a file to another folder",
"method": "POST",
"url": "/api/move",
"body": {
"nodeId": 4,
"newParentId": 2
},
"expectedStatus": 200
},
"moveFolderToDescendant": {
"description": "Try to move a folder into its descendant (should fail)",
"method": "POST",
"url": "/api/move",
"body": {
"nodeId": 1,
"newParentId": 2
},
"expectedStatus": 400
},
"getTree": {
"description": "Get the full folder tree",
"method": "GET",
"url": "/api/tree",
"expectedStatus": 200
},
"getAllNodes": {
"description": "Get all nodes (debug endpoint)",
"method": "GET",
"url": "/api/nodes",
"expectedStatus": 200
}
},
"curlExamples": {
"createFolder": "curl -X POST http://localhost:8080/api/node -H \"Content-Type: application/json\" -d '{\"name\": \"public\", \"type\": \"folder\", \"parentId\": null}'",
"createFile": "curl -X POST http://localhost:8080/api/node -H \"Content-Type: application/json\" -d '{\"name\": \"index.html\", \"type\": \"file\", \"size\": 1500, \"parentId\": 1}'",
"getTree": "curl http://localhost:8080/api/tree",
"moveFile": "curl -X POST http://localhost:8080/api/move -H \"Content-Type: application/json\" -d '{\"nodeId\": 4, \"newParentId\": 2}'",
"getAllNodes": "curl http://localhost:8080/api/nodes"
}
}