diff --git a/genotype_api/api/app.py b/genotype_api/api/app.py index a4ef7e4..664705b 100644 --- a/genotype_api/api/app.py +++ b/genotype_api/api/app.py @@ -7,7 +7,7 @@ from fastapi.responses import JSONResponse from fastapi.middleware.cors import CORSMiddleware -from genotype_api.config import security_settings, DBSettings, settings +from genotype_api.config import security_settings, settings from genotype_api.database.database import create_all_tables, initialise_database, close_session from genotype_api.api.endpoints import samples, snps, users, plates, analyses from sqlalchemy.exc import NoResultFound @@ -15,7 +15,6 @@ app = FastAPI( root_path=security_settings.api_root_path, root_path_in_servers=True, - openapi_prefix=security_settings.api_root_path, ) app.add_middleware( CORSMiddleware, diff --git a/genotype_api/dto/plate.py b/genotype_api/dto/plate.py index 3d3f5cf..65d3895 100644 --- a/genotype_api/dto/plate.py +++ b/genotype_api/dto/plate.py @@ -18,7 +18,7 @@ class PlateStatusCounts(BaseModel): commented: int = Field(0, nullable=True) class Config: - allow_population_by_field_name = True + populate_by_name = True class UserOnPlate(BaseModel): @@ -66,4 +66,4 @@ def check_detail(cls, value, values): return PlateStatusCounts(**status_counts, total=len(analyses), commented=commented) class Config: - validate_all = True + validate_default = True diff --git a/genotype_api/models.py b/genotype_api/models.py index fbcfbda..b1a1f1d 100644 --- a/genotype_api/models.py +++ b/genotype_api/models.py @@ -40,7 +40,7 @@ def validate_status(cls, value, values) -> SampleDetailStatus: return SampleDetailStatus(sex=sex, snps=snps, nocalls=nocalls) class Config: - validate_all = True + validate_default = True class MatchCounts(BaseModel):