fastapi function check too strict
See original GitHub issueI want to use fastapi with callables which return False on a inspect.is_function
check.
from fastapi import FastAPI
import toolz
def some_function():
...
def error_handler():
...
endpoint = toolz.excepts(Exception, some_function, error_handler)
app = FastAPI()
app.get("/")(endpoint)
Result:
AssertionError: An endpoint must be a function or method
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Query Parameters and String Validations - FastAPI
As we have to replace the default value None in the function with Query() ... This specific regular expression checks that the received...
Read more >FastAPI - The Good, the Bad and the Ugly - Infolytx
To do exception handling in FastAPI, you simply have to use @app.exception_handler annotation or app.add_exception_handler function to register the response for ...
Read more >4 Useful Advanced Features in FastAPI | by Ng Wai Foong
Moreover, I have covered two FastAPI tutorials on How to Migrate From Flask ... Event handlers — Register functions to be executed when...
Read more >FastAPI runs api-calls in serial instead of parallel fashion
Thus, if your function is not going to make any async calls, ... Note: When you call your endpoint for the second (third,...
Read more >FastAPI Tips & Tricks: Testing a Database - DEV Community
But if like me, you come from Django, you might still struggle to configure everything so that each test works in isolation, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah it’s just an example,
functools.partial
and I guesstoolz.compose
don’t work either.Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.