adriangb / xpresso

A composable Python ASGI web framework
https://xpresso-api.dev/
MIT License
178 stars 4 forks source link

feat: override dependency with a Depends #64

Open adriangb opened 2 years ago

adriangb commented 2 years ago
app.dependency_overrides[...] = Depends(...)
adriangb commented 2 years ago

Maybe the other way around as well:

x = Annotated[..., Depends(...)]
app.dependency_overrides[x] = ...
adriangb commented 2 years ago

These would be easy to implement, and I can envision some scenarios in which they would be useful, but I will wait to collect concrete use cases before implementing