File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
services/web/server/src/simcore_service_webserver/diagnostics Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,10 @@ class ProjectModel(BaseModel):
5858 name: str = Field(default = " Untitled Project" , min_length = 3 , max_length = 50 )
5959 created_at: datetime = Field(default_factory = datetime.now)
6060 value: int = Field(... , description = " Project value" )
61+ str_with_default: str = Field(default = " foo" )
62+
6163 config: dict = Field(default = {" version" : " 1.0" , " theme" : " default" })
6264
63- @field_validator (" name" )
64- def validate_name (cls , v ):
65- if v.isdigit():
66- raise ValueError (" Name cannot be only digits" )
67- return v
6865```
6966
7067### After:
@@ -80,11 +77,8 @@ class ProjectModel(BaseModel):
8077 name: Annotated[str , Field(min_length = 3 , max_length = 50 )] = " Untitled Project"
8178 created_at: Annotated[datetime, Field(default_factory = datetime.now)] = DEFAULT_FACTORY
8279 value: Annotated[int , Field(description = " Project value" )]
80+ str_with_default: str = " foo"
81+
8382 config: dict = {" version" : " 1.0" , " theme" : " default" }
8483
85- @field_validator (" name" )
86- def validate_name (cls , v ):
87- if v.isdigit():
88- raise ValueError (" Name cannot be only digits" )
89- return v
9084```
Original file line number Diff line number Diff line change 77
88from aiohttp import ClientError , ClientSession , web
99from models_library .app_diagnostics import AppStatusCheck
10- from pydantic import BaseModel , Field
10+ from pydantic import BaseModel
1111from servicelib .aiohttp .client_session import get_client_session
1212from servicelib .aiohttp .requests_validation import parse_request_query_parameters_as
1313from servicelib .utils import logged_gather
2929
3030
3131class StatusDiagnosticsQueryParam (BaseModel ):
32- top_tracemalloc : int | None = Field ( default = None )
32+ top_tracemalloc : int | None = None
3333
3434
3535class StatusDiagnosticsGet (BaseModel ):
You can’t perform that action at this time.
0 commit comments