Skip to content

Commit c86724c

Browse files
update open api specs
1 parent d9eee8f commit c86724c

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

api/specs/web-server/_projects_crud.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ async def get_project(project_id: ProjectID):
106106

107107
@router.put(
108108
"/projects/{project_id}",
109-
response_model=Envelope[ProjectGet],
109+
response_model=None,
110+
status_code=status.HTTP_410_GONE, # Deprecated endpoint
110111
)
111112
async def replace_project(project_id: ProjectID, _replace: ProjectReplace):
112113
"""Replaces (i.e. full update) a project resource"""

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,12 +3242,11 @@ paths:
32423242
$ref: '#/components/schemas/ProjectReplace'
32433243
required: true
32443244
responses:
3245-
'200':
3245+
'410':
32463246
description: Successful Response
32473247
content:
32483248
application/json:
3249-
schema:
3250-
$ref: '#/components/schemas/Envelope_ProjectGet_'
3249+
schema: {}
32513250
delete:
32523251
tags:
32533252
- projects
@@ -10603,15 +10602,15 @@ components:
1060310602
title: Value
1060410603
type: boolean
1060510604
description: True if the project is locked
10605+
status:
10606+
allOf:
10607+
- $ref: '#/components/schemas/ProjectStatus'
10608+
description: The status of the project
1060610609
owner:
1060710610
title: Owner
1060810611
allOf:
1060910612
- $ref: '#/components/schemas/Owner'
1061010613
description: If locked, the user that owns the lock
10611-
status:
10612-
allOf:
10613-
- $ref: '#/components/schemas/ProjectStatus'
10614-
description: The status of the project
1061510614
additionalProperties: false
1061610615
ProjectMetadataGet:
1061710616
title: ProjectMetadataGet
@@ -10841,6 +10840,7 @@ components:
1084110840
- EXPORTING
1084210841
- OPENING
1084310842
- OPENED
10843+
- MAINTAINING
1084410844
type: string
1084510845
description: An enumeration.
1084610846
ProjectTypeAPI:

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

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -394,28 +394,11 @@ async def get_project_inactivity(request: web.Request):
394394
@permission_required("services.pipeline.*") # due to update_pipeline_db
395395
async def replace_project(request: web.Request):
396396
"""
397-
In a PUT request, the enclosed entity is considered to be a modified version of
398-
the resource stored on the origin server, and the client is requesting that the
399-
stored version be replaced.
400-
401-
With PATCH, however, the enclosed entity contains a set of instructions describing how a
402-
resource currently residing on the origin server should be modified to produce a new version.
403-
404-
Also, another difference is that when you want to update a resource with PUT request, you have to send
405-
the full payload as the request whereas with PATCH, you only send the parameters which you want to update.
406-
407-
Raises:
408-
web.HTTPUnprocessableEntity: (422) if validation of request parameters fail
409-
web.HTTPBadRequest: invalid body encoding
410-
web.HTTPConflict: Cannot replace while pipeline is running
411-
web.HTTPBadRequest: jsonschema validatio error
412-
web.HTTPForbidden: Not enough access rights to replace this project
413-
web.HTTPNotFound: This project was not found
397+
Deprecated -> PATCH project OR dedicated /nodes (workbench) endpoints should be used instead
414398
"""
415399

416400
assert request # nosec
417-
msg = "Not supported anymore"
418-
raise ValueError(msg)
401+
return web.json_response(data="Deprecated endpoint", status=status.HTTP_410_GONE)
419402

420403

421404
@routes.patch(f"/{VTAG}/projects/{{project_id}}", name="patch_project")

services/web/server/tests/unit/with_dbs/03/folders/test_folders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ async def test_project_listing_inside_of_private_folder(
313313
resp = await client.get(url)
314314
_, errors = await assert_status(
315315
resp,
316-
status.HTTP_401_UNAUTHORIZED,
316+
status.HTTP_403_FORBIDDEN,
317317
)
318318
assert errors
319319

0 commit comments

Comments
 (0)