From 50e082ef66a0045833b7913dad1500a997e7133b Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Mon, 5 Aug 2024 10:19:49 -0400 Subject: [PATCH] refactor: address config deprecation --- server/src/curfu/schemas.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/server/src/curfu/schemas.py b/server/src/curfu/schemas.py index 73cf5996..5976d939 100644 --- a/server/src/curfu/schemas.py +++ b/server/src/curfu/schemas.py @@ -19,7 +19,7 @@ UnknownGeneElement, ) from ga4gh.vrsatile.pydantic.vrsatile_models import CURIE -from pydantic import BaseModel, Extra, Field, StrictInt, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, validator ResponseWarnings = list[StrictStr] | None @@ -88,10 +88,7 @@ class ClientFunctionalDomain(FunctionalDomain): domain_id: str - class Config: - """Configure class.""" - - extra = Extra.forbid + model_config = ConfigDict(extra="forbid") class ClientRegulatoryElement(RegulatoryElement): @@ -106,10 +103,7 @@ class Response(BaseModel): warnings: ResponseWarnings - class Config: - """Configure class""" - - extra = Extra.forbid + model_config = ConfigDict(extra="forbid") class GeneElementResponse(Response):