Closed imnasnainaec closed 6 months ago
In https://github.com/silnrsi/langfontfinder/blob/main/lib/langfontfinder/api.py#L33-L41, changing
Path("", description="Language tag"))
-> Path(description="Language tag"))
Path("", description="Font family id"))
-> Path(description="Font family id"))
... eliminated the error, so when I run api.py
I get:
INFO: Started server process [6636]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
But then http://127.0.0.1:8000
only shows {"detail":"Not Found"}
so I don't know if that correctly fixes the issue.
Potential pr with that change: https://github.com/silnrsi/langfontfinder/compare/main...imnasnainaec:langfontfinder:lib-langfontfinder-apy-py-path-default
@DavidLRowe When running lib/langfontfinder/api.py
, is the expected default to see {"detail":"Not Found"}
at http://127.0.0.1:8000
?
@mhosken Can you comment on this issue when you have the time?
My guess this comes from building on sand. Sigh. I so liked the conservative nature of python in the past. Ah well. I'm quite happy seeing this change so long as it doesn't break the server.
Pulling @tim-eves to check this isn't going to break production
@imnasnainaec Thanks for reporting this. It seems to be due to you using a later version of fastapi than we currently have. @tim-eves plans to implement your suggestion for changes, then include a version in the requirements.txt in order to catch any similar changes in future.
The {"detail":"Not Found"}
return is expected. It is essentially a text rendering of the 404 "Not Found" response that happens when there's a missing parameter.
Thanks again for reporting this.
I'll wait to close this until the fix is actually in place.
Fixed in GH-15, in turns out this was always a problem because Path() parameters are always required so the default value is nonsensical for a Path. The newer version just got stricter about not allowing it.
Here's the error
I'm on Windows 11 using Python 3.11 with the following libraries loaded: