I don't understand optional query parameters in FastAPI. How is it different from default query parameters with a default value of None
?
What is the difference between arg1
and arg2
in the example below where arg2
is made an optional query parameter as described in the above link?
@app.get("/info/")
async def info(arg1: int = None, arg2: int | None = None):
return {"arg1": arg1, "arg2": arg2}