Answers for "FastAPI SyntaxError: non-default argument follows default argument"

0

FastAPI SyntaxError: non-default argument follows default argument

from fastapi import FastAPI, Path

app = FastAPI()


@app.get("/items/{item_id}")
async def read_items(
    q: str, item_id: int = Path(..., title="The ID of the item to get")
):
    results = {"item_id": item_id}
    if q:
        results.update({"q": q})
    return results
Posted by: Guest on May-24-2021

Code answers related to "FastAPI SyntaxError: non-default argument follows default argument"

Python Answers by Framework

Browse Popular Code Answers by Language