Skip to content

Commit 386c316

Browse files
remove unnecessary schema patch
1 parent 2a8d6eb commit 386c316

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Models a study's project document
33
"""
4-
from copy import deepcopy
54
from datetime import datetime
65
from enum import Enum
76
from typing import Any, Final, TypeAlias
@@ -113,13 +112,6 @@ def convert_sql_alchemy_enum(cls, v):
113112
)
114113

115114

116-
def _patch_json_schema_extra(schema: dict) -> None:
117-
# Patch to allow jsonschema nullable
118-
# SEE https://github.com/samuelcolvin/pydantic/issues/990#issuecomment-645961530
119-
state_pydantic_schema = deepcopy(schema["properties"]["state"])
120-
schema["properties"]["state"] = {"anyOf": [{"type": "null"}, state_pydantic_schema]}
121-
122-
123115
class Project(BaseProjectModel):
124116
# NOTE: This is the pydantic pendant of project-v0.0.1.json used in the API of the webserver/webclient
125117
# NOT for usage with DB!!
@@ -182,5 +174,4 @@ class Project(BaseProjectModel):
182174
model_config = ConfigDict(
183175
title="osparc-simcore project",
184176
extra="forbid",
185-
json_schema_extra=_patch_json_schema_extra,
186177
)

0 commit comments

Comments
 (0)