Skip to content

Commit 1455c25

Browse files
committed
Use kebab-case for API path components, and treat "score sets" as two words.
1 parent 808fef9 commit 1455c25

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/mavedb/routers/mapped_variant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def fetch_mapped_variant_by_variant_urn(db, urn: str) -> Optional[MappedVa
2929
raise HTTPException(status_code=404, detail=f"Mapped variant with URN {urn} not found")
3030
return item
3131

32-
router = APIRouter(prefix="/api/v1/mappedVariants", tags=["mapped variants"], responses={404: {"description": "Not found"}})
32+
router = APIRouter(prefix="/api/v1/mapped-variants", tags=["mapped variants"], responses={404: {"description": "Not found"}})
3333

3434
@router.get("/{urn}", status_code=200, response_model=mapped_variant.MappedVariant, responses={404: {}, 500: {}})
3535
async def show_mapped_variant(

src/mavedb/routers/score_sets.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,21 @@ async def get_score_set_counts_csv(
182182

183183

184184
@router.get(
185-
"/scoresets/{urn}/mappedVariants", status_code=200, response_model=list[mapped_variant.MappedVariant])
186-
def get_scoreset_mapped_variants(
185+
"/score-sets/{urn}/mapped-variants", status_code=200, response_model=list[mapped_variant.MappedVariant])
186+
def get_score_set_mapped_variants(
187187
*,
188188
urn: str,
189189
db: Session = Depends(deps.get_db),
190190
) -> Any:
191191
"""
192-
Return mapped variants from a scoreset, identified by URN.
192+
Return mapped variants from a score set, identified by URN.
193193
"""
194194
mapped_variants = (
195-
db.query(MappedVariant).filter(Scoreset.urn == urn).filter(Scoreset.id == Variant.scoreset_id).filter(Variant.id == MappedVariant.variant_id).all()
195+
db.query(MappedVariant).filter(ScoreSet.urn == urn).filter(ScoreSet.id == Variant.score_set_id).filter(Variant.id == MappedVariant.variant_id).all()
196196
)
197197

198198
if not mapped_variants:
199-
raise HTTPException(status_code=404, detail=f"No mapped variant associated with scoreset URN {urn} was found")
199+
raise HTTPException(status_code=404, detail=f"No mapped variant associated with score set URN {urn} was found")
200200

201201
return mapped_variants
202202

0 commit comments

Comments
 (0)