79601702

Date: 2025-05-01 10:30:49
Score: 0.5
Natty:
Report link

FastAPI expects to return something JSON-serializable, so instead of returning a plain string, return a dictionary:

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def first_api(): 
    return {"message": "Hello World"}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Dmitriy Danylov