|
25 | 25 | ) |
26 | 26 |
|
27 | 27 | router = APIRouter( |
28 | | - prefix="/api/v1", tags=["Variants"], responses={404: {"description": "Not found"}}, route_class=LoggedRoute |
| 28 | + prefix="/api/v1", |
| 29 | + tags=["Variants"], |
| 30 | + responses={ |
| 31 | + 404: {"description": "Not found"}, |
| 32 | + 500: {"description": "Internal server error"}, |
| 33 | + }, |
| 34 | + route_class=LoggedRoute, |
29 | 35 | ) |
30 | 36 |
|
31 | 37 | logger = logging.getLogger(__name__) |
32 | 38 |
|
33 | 39 |
|
34 | | -@router.post("/variants/clingen-allele-id-lookups", response_model=list[ClingenAlleleIdVariantLookupResponse]) |
| 40 | +@router.post( |
| 41 | + "/variants/clingen-allele-id-lookups", |
| 42 | + status_code=200, |
| 43 | + response_model=list[ClingenAlleleIdVariantLookupResponse], |
| 44 | + responses={ |
| 45 | + 400: {"description": "Bad request"}, |
| 46 | + 401: {"description": "Not authenticated"}, |
| 47 | + 403: {"description": "User lacks necessary permissions"}, |
| 48 | + }, |
| 49 | + summary="Lookup variants by ClinGen Allele IDs", |
| 50 | +) |
35 | 51 | def lookup_variants( |
36 | 52 | *, |
37 | 53 | request: ClingenAlleleIdVariantLookupsRequest, |
38 | 54 | db: Session = Depends(deps.get_db), |
39 | 55 | user_data: UserData = Depends(get_current_user), |
40 | 56 | ): |
| 57 | + """ |
| 58 | + Lookup variants by ClinGen Allele IDs. |
| 59 | + """ |
41 | 60 | save_to_logging_context({"requested_resource": "clingen-allele-id-lookups"}) |
42 | 61 | save_to_logging_context({"clingen_allele_ids_to_lookup": request.clingen_allele_ids}) |
43 | 62 | logger.debug(msg="Looking up variants by Clingen Allele IDs", extra=logging_context()) |
@@ -409,8 +428,12 @@ def lookup_variants( |
409 | 428 | "/variants/{urn}", |
410 | 429 | status_code=200, |
411 | 430 | response_model=VariantEffectMeasurementWithScoreSet, |
412 | | - responses={404: {}, 500: {}}, |
| 431 | + responses={ |
| 432 | + 401: {"description": "Not authenticated"}, |
| 433 | + 403: {"description": "User lacks necessary permissions"}, |
| 434 | + }, |
413 | 435 | response_model_exclude_none=True, |
| 436 | + summary="Fetch variant by URN", |
414 | 437 | ) |
415 | 438 | def get_variant(*, urn: str, db: Session = Depends(deps.get_db), user_data: UserData = Depends(get_current_user)): |
416 | 439 | """ |
|
0 commit comments