Files
ray-project--ray/python/ray/tests/pydantic_module.py
T
2026-07-13 13:17:40 +08:00

27 lines
311 B
Python

from fastapi import FastAPI
from pydantic import BaseModel
class User(BaseModel):
name: str
user = User(name="a")
app = FastAPI()
@app.get("/")
def h(u: User) -> str:
return "a"
def closure():
app = FastAPI()
@app.get("/")
def h(u: User) -> str:
return "a"
return app