diff --git a/routes/enterprise.py b/routes/enterprise.py index fdb3b28..2ed18d1 100644 --- a/routes/enterprise.py +++ b/routes/enterprise.py @@ -1,4 +1,4 @@ -from fastapi import APIRouter, HTTPException, Query +from fastapi import APIRouter, HTTPException, Query, Path import httpx import logging from datetime import datetime @@ -55,11 +55,11 @@ async def rechercher_entreprise( @router.get("/siren/{siren}", response_model=EntrepriseSearch) async def lire_entreprise_par_siren( - siren: str = Query( + siren: str = Path( ..., min_length=9, max_length=9, - regex=r"^\d{9}$", + pattern=r"^\d{9}$", description="Numéro SIREN (9 chiffres)", ), ): @@ -106,11 +106,11 @@ async def lire_entreprise_par_siren( @router.get("/tva/{siren}") async def calculer_tva( - siren: str = Query( + siren: str = Path( ..., min_length=9, max_length=9, - regex=r"^\d{9}$", + pattern=r"^\d{9}$", description="Numéro SIREN (9 chiffres)", ), ):