Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Apr 3, 2024
1 parent ea58682 commit 27977b4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
10 changes: 10 additions & 0 deletions genotype_api/api/endpoints/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ def create_sample(
@router.get(
"/",
response_model=list[SampleResponse],
response_model_exclude={
"detail": {
"sex": True,
"nocalls": True,
"snps": True,
"matches": True,
"mismatches": True,
"unknown": True,
},
},
)
def read_samples(
skip: int = 0,
Expand Down
34 changes: 17 additions & 17 deletions genotype_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@


class SampleDetailStats(BaseModel):
matches: int | None
mismatches: int | None
unknown: int | None
matches: int | None = None
mismatches: int | None = None
unknown: int | None = None


class SampleDetailStatus(BaseModel):
sex: str | None
snps: str | None
nocalls: str | None
sex: str | None = None
snps: str | None = None
nocalls: str | None = None


class SampleDetail(BaseModel):
sex: str | None
snps: str | None
nocalls: str | None
matches: int | None
mismatches: int | None
unknown: int | None
failed_snps: list[str] | None
sex: str | None = None
snps: str | None = None
nocalls: str | None = None
matches: int | None = None
mismatches: int | None = None
unknown: int | None = None
failed_snps: list[str] | None = None

stats: SampleDetailStats | None
status: SampleDetailStatus | None
stats: SampleDetailStats | None = None
status: SampleDetailStatus | None = None

@validator("stats")
def validate_stats(cls, value, values) -> SampleDetailStats:
Expand All @@ -50,5 +50,5 @@ class MatchCounts(BaseModel):


class MatchResult(BaseModel):
sample_id: str
match_results: MatchCounts
sample_id: str = None
match_results: MatchCounts | None = None

0 comments on commit 27977b4

Please sign in to comment.