Skip to content

Commit 27ceb6f

Browse files
♻️ Remove PUT project endpoint (#6604)
1 parent 7e052f5 commit 27ceb6f

File tree

10 files changed

+51
-469
lines changed

10 files changed

+51
-469
lines changed

api/specs/web-server/_projects_crud.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
ProjectGet,
2323
ProjectListItem,
2424
ProjectPatch,
25-
ProjectReplace,
2625
)
2726
from models_library.generics import Envelope
2827
from models_library.projects import ProjectID
@@ -104,14 +103,6 @@ async def get_project(project_id: ProjectID):
104103
...
105104

106105

107-
@router.put(
108-
"/projects/{project_id}",
109-
response_model=Envelope[ProjectGet],
110-
)
111-
async def replace_project(project_id: ProjectID, _replace: ProjectReplace):
112-
"""Replaces (i.e. full update) a project resource"""
113-
114-
115106
@router.patch(
116107
"/projects/{project_id}",
117108
response_model=None,

packages/models-library/src/models_library/api_schemas_webserver/projects.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,6 @@ class ProjectReplace(InputSchema):
121121
)
122122

123123

124-
class ProjectUpdate(InputSchema):
125-
name: ShortTruncatedStr = FieldNotRequired()
126-
description: LongTruncatedStr = FieldNotRequired()
127-
thumbnail: HttpUrlWithCustomMinLength = FieldNotRequired()
128-
workbench: NodesDict = FieldNotRequired()
129-
access_rights: dict[GroupIDStr, AccessRights] = FieldNotRequired()
130-
tags: list[int] = FieldNotRequired()
131-
classifiers: list[ClassifierID] = FieldNotRequired()
132-
ui: StudyUI | None = None
133-
quality: dict[str, Any] = FieldNotRequired()
134-
135-
136124
class ProjectPatch(InputSchema):
137125
name: ShortTruncatedStr = FieldNotRequired()
138126
description: LongTruncatedStr = FieldNotRequired()
@@ -143,6 +131,10 @@ class ProjectPatch(InputSchema):
143131
ui: StudyUI | None = FieldNotRequired()
144132
quality: dict[str, Any] = FieldNotRequired()
145133

134+
_empty_is_none = validator("thumbnail", allow_reuse=True, pre=True)(
135+
empty_str_to_none_pre_validator
136+
)
137+
146138

147139
__all__: tuple[str, ...] = (
148140
"EmptyModel",
@@ -151,6 +143,5 @@ class ProjectPatch(InputSchema):
151143
"ProjectGet",
152144
"ProjectListItem",
153145
"ProjectReplace",
154-
"ProjectUpdate",
155146
"TaskProjectGet",
156147
)

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

Lines changed: 6 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,33 +3221,6 @@ paths:
32213221
application/json:
32223222
schema:
32233223
$ref: '#/components/schemas/Envelope_ProjectGet_'
3224-
put:
3225-
tags:
3226-
- projects
3227-
summary: Replace Project
3228-
description: Replaces (i.e. full update) a project resource
3229-
operationId: replace_project
3230-
parameters:
3231-
- required: true
3232-
schema:
3233-
title: Project Id
3234-
type: string
3235-
format: uuid
3236-
name: project_id
3237-
in: path
3238-
requestBody:
3239-
content:
3240-
application/json:
3241-
schema:
3242-
$ref: '#/components/schemas/ProjectReplace'
3243-
required: true
3244-
responses:
3245-
'200':
3246-
description: Successful Response
3247-
content:
3248-
application/json:
3249-
schema:
3250-
$ref: '#/components/schemas/Envelope_ProjectGet_'
32513224
delete:
32523225
tags:
32533226
- projects
@@ -4331,7 +4304,7 @@ paths:
43314304
'403':
43324305
description: ProjectInvalidRightsError
43334306
'404':
4334-
description: ProjectNotFoundError, UserDefaultWalletNotFoundError
4307+
description: UserDefaultWalletNotFoundError, ProjectNotFoundError
43354308
'409':
43364309
description: ProjectTooManyProjectOpenedError
43374310
'422':
@@ -10603,15 +10576,15 @@ components:
1060310576
title: Value
1060410577
type: boolean
1060510578
description: True if the project is locked
10579+
status:
10580+
allOf:
10581+
- $ref: '#/components/schemas/ProjectStatus'
10582+
description: The status of the project
1060610583
owner:
1060710584
title: Owner
1060810585
allOf:
1060910586
- $ref: '#/components/schemas/Owner'
1061010587
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
1061510588
additionalProperties: false
1061610589
ProjectMetadataGet:
1061710590
title: ProjectMetadataGet
@@ -10741,68 +10714,6 @@ components:
1074110714
is_public:
1074210715
title: Is Public
1074310716
type: boolean
10744-
ProjectReplace:
10745-
title: ProjectReplace
10746-
required:
10747-
- uuid
10748-
- name
10749-
- description
10750-
- creationDate
10751-
- lastChangeDate
10752-
- workbench
10753-
- accessRights
10754-
type: object
10755-
properties:
10756-
uuid:
10757-
title: Uuid
10758-
type: string
10759-
format: uuid
10760-
name:
10761-
title: Name
10762-
type: string
10763-
description:
10764-
title: Description
10765-
type: string
10766-
thumbnail:
10767-
title: Thumbnail
10768-
maxLength: 2083
10769-
minLength: 0
10770-
type: string
10771-
format: uri
10772-
creationDate:
10773-
title: Creationdate
10774-
pattern: \d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[0-9])(:(\d|[0-5]\d)){2}(\.\d{3})?Z
10775-
type: string
10776-
lastChangeDate:
10777-
title: Lastchangedate
10778-
pattern: \d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[0-9])(:(\d|[0-5]\d)){2}(\.\d{3})?Z
10779-
type: string
10780-
workbench:
10781-
title: Workbench
10782-
type: object
10783-
additionalProperties:
10784-
$ref: '#/components/schemas/Node'
10785-
accessRights:
10786-
title: Accessrights
10787-
type: object
10788-
additionalProperties:
10789-
$ref: '#/components/schemas/models_library__projects_access__AccessRights'
10790-
tags:
10791-
title: Tags
10792-
type: array
10793-
items:
10794-
type: integer
10795-
default: []
10796-
classifiers:
10797-
title: Classifiers
10798-
type: array
10799-
items:
10800-
type: string
10801-
ui:
10802-
$ref: '#/components/schemas/StudyUI'
10803-
quality:
10804-
title: Quality
10805-
type: object
1080610717
ProjectRunningState:
1080710718
title: ProjectRunningState
1080810719
required:
@@ -10841,6 +10752,7 @@ components:
1084110752
- EXPORTING
1084210753
- OPENING
1084310754
- OPENED
10755+
- MAINTAINING
1084410756
type: string
1084510757
description: An enumeration.
1084610758
ProjectTypeAPI:

0 commit comments

Comments
 (0)