Skip to content

Commit b77602c

Browse files
open api specs
1 parent 7061af7 commit b77602c

File tree

7 files changed

+29
-27
lines changed

7 files changed

+29
-27
lines changed

api/specs/web-server/_folders.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ async def delete_folder(
102102
...
103103

104104

105-
@router.put(
106-
"/folders/{folder_id}/workspaces/{workspace_id}",
105+
@router.post(
106+
"/folders/{folder_id}/workspaces/{workspace_id}:move",
107107
status_code=status.HTTP_204_NO_CONTENT,
108108
summary="Move folder to the workspace",
109109
tags=["workspaces"],
110110
)
111-
async def replace_folder_workspace(
111+
async def move_folder_to_workspace(
112112
_path: Annotated[_FolderWorkspacesPathParams, Depends()],
113113
):
114114
...

api/specs/web-server/_projects_workspaces.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
)
2424

2525

26-
@router.put(
27-
"/projects/{project_id}/workspaces/{workspace_id}",
26+
@router.post(
27+
"/projects/{project_id}/workspaces/{workspace_id}:move",
2828
status_code=status.HTTP_204_NO_CONTENT,
2929
summary="Move project to the workspace",
3030
)
31-
async def replace_project_workspace(
31+
async def move_project_to_workspace(
3232
_path: Annotated[_ProjectWorkspacesPathParams, Depends()],
3333
):
3434
...

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,13 +2944,13 @@ paths:
29442944
schema:
29452945
$ref: '#/components/schemas/EnvelopedError'
29462946
description: Service Unavailable
2947-
/v0/folders/{folder_id}/workspaces/{workspace_id}:
2948-
put:
2947+
/v0/folders/{folder_id}/workspaces/{workspace_id}:move:
2948+
post:
29492949
tags:
29502950
- folders
29512951
- workspaces
29522952
summary: Move folder to the workspace
2953-
operationId: replace_folder_workspace
2953+
operationId: move_folder_to_workspace
29542954
parameters:
29552955
- name: folder_id
29562956
in: path
@@ -4759,13 +4759,13 @@ paths:
47594759
application/json:
47604760
schema:
47614761
$ref: '#/components/schemas/Envelope_WalletGet_'
4762-
/v0/projects/{project_id}/workspaces/{workspace_id}:
4763-
put:
4762+
/v0/projects/{project_id}/workspaces/{workspace_id}:move:
4763+
post:
47644764
tags:
47654765
- projects
47664766
- workspaces
47674767
summary: Move project to the workspace
4768-
operationId: replace_project_workspace
4768+
operationId: move_project_to_workspace
47694769
parameters:
47704770
- name: project_id
47714771
in: path

services/web/server/src/simcore_service_webserver/folders/_workspaces_handlers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
routes = web.RouteTableDef()
1818

1919

20-
@routes.put(
21-
f"/{VTAG}/folders/{{folder_id}}/workspaces/{{workspace_id}}",
22-
name="replace_folder_workspace",
20+
@routes.post(
21+
f"/{VTAG}/folders/{{folder_id}}/workspaces/{{workspace_id}}:move",
22+
name="move_folder_to_workspace",
2323
)
2424
@login_required
2525
@permission_required("folder.update")
2626
@handle_plugin_requests_exceptions
27-
async def replace_project_workspace(request: web.Request):
27+
async def move_folder_to_workspace(request: web.Request):
2828
req_ctx = FoldersRequestContext.model_validate(request)
2929
path_params = parse_request_path_parameters_as(_FolderWorkspacesPathParams, request)
3030

services/web/server/src/simcore_service_webserver/projects/_workspaces_handlers.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,21 @@ async def wrapper(request: web.Request) -> web.StreamResponse:
5151

5252
class _ProjectWorkspacesPathParams(BaseModel):
5353
project_id: ProjectID
54-
workspace_id: Annotated[WorkspaceID | None, BeforeValidator(null_or_none_str_to_none_validator)] = Field(default=None)
54+
workspace_id: Annotated[
55+
WorkspaceID | None, BeforeValidator(null_or_none_str_to_none_validator)
56+
] = Field(default=None)
5557

5658
model_config = ConfigDict(extra="forbid")
5759

5860

59-
@routes.put(
60-
f"/{VTAG}/projects/{{project_id}}/workspaces/{{workspace_id}}",
61-
name="replace_project_workspace",
61+
@routes.post(
62+
f"/{VTAG}/projects/{{project_id}}/workspaces/{{workspace_id}}:move",
63+
name="move_project_to_workspace",
6264
)
6365
@login_required
6466
@permission_required("project.workspaces.*")
6567
@_handle_projects_workspaces_exceptions
66-
async def replace_project_workspace(request: web.Request):
68+
async def move_project_to_workspace(request: web.Request):
6769
req_ctx = RequestContext.model_validate(request)
6870
path_params = parse_request_path_parameters_as(
6971
_ProjectWorkspacesPathParams, request

services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__moving_folders_between_workspaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def _move_folder_to_workspace_and_assert(
165165
assert client.app
166166

167167
# MOVE
168-
url = client.app.router["replace_folder_workspace"].url_for(
168+
url = client.app.router["move_folder_to_workspace"].url_for(
169169
folder_id=folder_id,
170170
workspace_id=workspace_id,
171171
)

services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__moving_projects_between_workspaces.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def test_moving_between_workspaces_user_role_permissions(
5555
workspaces_clean_db: None,
5656
):
5757
# Move project from workspace to your private workspace
58-
base_url = client.app.router["replace_project_workspace"].url_for(
58+
base_url = client.app.router["move_project_to_workspace"].url_for(
5959
project_id=fake_project["uuid"], workspace_id="null"
6060
)
6161
resp = await client.put(f"{base_url}")
@@ -103,7 +103,7 @@ async def test_moving_between_private_and_shared_workspaces(
103103
assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID
104104

105105
# Move project from workspace to your private workspace
106-
base_url = client.app.router["replace_project_workspace"].url_for(
106+
base_url = client.app.router["move_project_to_workspace"].url_for(
107107
project_id=project["uuid"], workspace_id="null"
108108
)
109109
resp = await client.put(f"{base_url}")
@@ -116,7 +116,7 @@ async def test_moving_between_private_and_shared_workspaces(
116116
assert data["workspaceId"] is None # <-- Workspace ID is None
117117

118118
# Move project from your private workspace to shared workspace
119-
base_url = client.app.router["replace_project_workspace"].url_for(
119+
base_url = client.app.router["move_project_to_workspace"].url_for(
120120
project_id=project["uuid"], workspace_id=f"{added_workspace['workspaceId']}"
121121
)
122122
resp = await client.put(f"{base_url}")
@@ -182,7 +182,7 @@ async def test_moving_between_shared_and_shared_workspaces(
182182
assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID
183183

184184
# Move project from workspace to your private workspace
185-
base_url = client.app.router["replace_project_workspace"].url_for(
185+
base_url = client.app.router["move_project_to_workspace"].url_for(
186186
project_id=project["uuid"], workspace_id=f"{second_workspace['workspaceId']}"
187187
)
188188
resp = await client.put(f"{base_url}")
@@ -262,7 +262,7 @@ async def test_moving_between_workspaces_check_removed_from_folder(
262262
assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID
263263

264264
# Move project from workspace to your private workspace
265-
base_url = client.app.router["replace_project_workspace"].url_for(
265+
base_url = client.app.router["move_project_to_workspace"].url_for(
266266
project_id=project["uuid"], workspace_id="none"
267267
)
268268
resp = await client.put(f"{base_url}")

0 commit comments

Comments
 (0)