FastAPI - Dependency Injection
Given the code below, what will be the output when accessing the
/items/ endpoint?from fastapi import FastAPI, Depends
app = FastAPI()
def get_number():
return 42
@app.get('/items/')
def read_items(number: int = Depends(get_number)):
return {"number": number}