VariantEffect / mavedb-api

MaveDB API
GNU Affero General Public License v3.0
8 stars 2 forks source link

DOI based publications return 404s on GET #220

Open bencap opened 1 month ago

bencap commented 1 month ago

DOI based publications use the DOI as their identifier, which contain slashes. FastAPI/Starlette don't provide a way to escape forward slashes in requests (see https://github.com/tiangolo/fastapi/discussions/7328). When a request is made for a DOI based publication (for example: GET /api/v1/publication-identifiers/10.1016/j.cell.2024.04.018), this request matches the path db_name=10.1016, identifier=j.cell.2024.04.018.

The suggested workaround is to use identifier:path to match request paths which may include paths, but this will cause the route to match the entire rest of the path, so requests like GET /api/v1/publication-identifiers/Crossref/10.1016/j.cell.2024.04.018 will resolve to identifier=Crossref/10.1016/j.cell.2024.04.018. From here we would be able to parse out the desired request, but this would require some changes to the design of the publication-identifiers endpoint.