Skip to content
Merged
9 changes: 0 additions & 9 deletions api/specs/web-server/_projects_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
ProjectGet,
ProjectListItem,
ProjectPatch,
ProjectReplace,
)
from models_library.generics import Envelope
from models_library.projects import ProjectID
Expand Down Expand Up @@ -104,14 +103,6 @@ async def get_project(project_id: ProjectID):
...


@router.put(
"/projects/{project_id}",
response_model=Envelope[ProjectGet],
)
async def replace_project(project_id: ProjectID, _replace: ProjectReplace):
"""Replaces (i.e. full update) a project resource"""


@router.patch(
"/projects/{project_id}",
response_model=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,6 @@ class ProjectReplace(InputSchema):
)


class ProjectUpdate(InputSchema):
name: ShortTruncatedStr = FieldNotRequired()
description: LongTruncatedStr = FieldNotRequired()
thumbnail: HttpUrlWithCustomMinLength = FieldNotRequired()
workbench: NodesDict = FieldNotRequired()
access_rights: dict[GroupIDStr, AccessRights] = FieldNotRequired()
tags: list[int] = FieldNotRequired()
classifiers: list[ClassifierID] = FieldNotRequired()
ui: StudyUI | None = None
quality: dict[str, Any] = FieldNotRequired()


class ProjectPatch(InputSchema):
name: ShortTruncatedStr = FieldNotRequired()
description: LongTruncatedStr = FieldNotRequired()
Expand All @@ -143,6 +131,10 @@ class ProjectPatch(InputSchema):
ui: StudyUI | None = FieldNotRequired()
quality: dict[str, Any] = FieldNotRequired()

_empty_is_none = validator("thumbnail", allow_reuse=True, pre=True)(
empty_str_to_none_pre_validator
)


__all__: tuple[str, ...] = (
"EmptyModel",
Expand All @@ -151,6 +143,5 @@ class ProjectPatch(InputSchema):
"ProjectGet",
"ProjectListItem",
"ProjectReplace",
"ProjectUpdate",
"TaskProjectGet",
)
Original file line number Diff line number Diff line change
Expand Up @@ -3221,33 +3221,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Envelope_ProjectGet_'
put:
tags:
- projects
summary: Replace Project
description: Replaces (i.e. full update) a project resource
operationId: replace_project
parameters:
- required: true
schema:
title: Project Id
type: string
format: uuid
name: project_id
in: path
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProjectReplace'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_ProjectGet_'
delete:
tags:
- projects
Expand Down Expand Up @@ -4331,7 +4304,7 @@ paths:
'403':
description: ProjectInvalidRightsError
'404':
description: ProjectNotFoundError, UserDefaultWalletNotFoundError
description: UserDefaultWalletNotFoundError, ProjectNotFoundError
'409':
description: ProjectTooManyProjectOpenedError
'422':
Expand Down Expand Up @@ -10603,15 +10576,15 @@ components:
title: Value
type: boolean
description: True if the project is locked
status:
allOf:
- $ref: '#/components/schemas/ProjectStatus'
description: The status of the project
owner:
title: Owner
allOf:
- $ref: '#/components/schemas/Owner'
description: If locked, the user that owns the lock
status:
allOf:
- $ref: '#/components/schemas/ProjectStatus'
description: The status of the project
additionalProperties: false
ProjectMetadataGet:
title: ProjectMetadataGet
Expand Down Expand Up @@ -10741,68 +10714,6 @@ components:
is_public:
title: Is Public
type: boolean
ProjectReplace:
title: ProjectReplace
required:
- uuid
- name
- description
- creationDate
- lastChangeDate
- workbench
- accessRights
type: object
properties:
uuid:
title: Uuid
type: string
format: uuid
name:
title: Name
type: string
description:
title: Description
type: string
thumbnail:
title: Thumbnail
maxLength: 2083
minLength: 0
type: string
format: uri
creationDate:
title: Creationdate
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
type: string
lastChangeDate:
title: Lastchangedate
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
type: string
workbench:
title: Workbench
type: object
additionalProperties:
$ref: '#/components/schemas/Node'
accessRights:
title: Accessrights
type: object
additionalProperties:
$ref: '#/components/schemas/models_library__projects_access__AccessRights'
tags:
title: Tags
type: array
items:
type: integer
default: []
classifiers:
title: Classifiers
type: array
items:
type: string
ui:
$ref: '#/components/schemas/StudyUI'
quality:
title: Quality
type: object
ProjectRunningState:
title: ProjectRunningState
required:
Expand Down Expand Up @@ -10841,6 +10752,7 @@ components:
- EXPORTING
- OPENING
- OPENED
- MAINTAINING
type: string
description: An enumeration.
ProjectTypeAPI:
Expand Down
Loading
Loading