Skip to content

Commit cbe5c74

Browse files
committed
further reduce backwards incompatibility
1 parent a3b03d0 commit cbe5c74

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

services/api-server/src/simcore_service_api_server/models/domain/groups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
class UsersGroup(BaseModel):
55
gid: str
66
label: str
7-
description: str | None = None
7+
description: str = None # TODO: should be nullable
88

99

1010
class Groups(BaseModel):
1111
me: UsersGroup
12-
organizations: list[UsersGroup] | None = []
12+
organizations: list[UsersGroup] = [] # TODO: should be nullable
1313
all_: UsersGroup = Field(..., alias="all")

services/api-server/src/simcore_service_api_server/models/schemas/profiles.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99

1010

1111
class ProfileCommon(BaseModel):
12-
first_name: FirstNameStr | None = Field(None, examples=["James"])
13-
last_name: LastNameStr | None = Field(None, examples=["Maxwell"])
12+
first_name: FirstNameStr = Field(
13+
None, examples=["James"]
14+
) # TODO: should be nullable
15+
last_name: LastNameStr = Field(
16+
None, examples=["Maxwell"]
17+
) # TODO: should be nullable
1418

1519

1620
class ProfileUpdate(ProfileCommon):
@@ -31,12 +35,12 @@ class Profile(ProfileCommon):
3135
id_: UserID = Field(alias="id")
3236
login: LowerCaseEmailStr
3337
role: UserRoleEnum
34-
groups: Groups | None = None
35-
gravatar_id: str | None = Field(
38+
groups: Groups = None # TODO: should be nullable
39+
gravatar_id: str = Field(
3640
None,
3741
description="md5 hash value of email to retrieve an avatar image from https://www.gravatar.com",
3842
max_length=40,
39-
)
43+
) # TODO: should be nullable
4044

4145
@field_validator("role", mode="before")
4246
@classmethod

0 commit comments

Comments
 (0)