|
@ -17,38 +17,30 @@ def test_input_and_url_fields_with_pydanticv2(include_error_input, include_error |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
@app.get("/get1/{path_param}") |
|
|
@app.get("/get1/{path_param}") |
|
|
def get1(path_param: int): |
|
|
def get1(path_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@app.get("/get2/") |
|
|
@app.get("/get2/") |
|
|
def get2(query_param: int): |
|
|
def get2(query_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
class Body1(BaseModel): |
|
|
class Body1(BaseModel): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
class Body2(BaseModel): |
|
|
class Body2(BaseModel): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@app.post("/post1/") |
|
|
@app.post("/post1/") |
|
|
def post1(body1: Body1, body2: Body2): |
|
|
def post1(body1: Body1, body2: Body2): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
router = APIRouter( |
|
|
router = APIRouter( |
|
|
include_error_input=include_error_input, include_error_url=include_error_url |
|
|
include_error_input=include_error_input, include_error_url=include_error_url |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
@router.get("/get3/{path_param}") |
|
|
@router.get("/get3/{path_param}") |
|
|
def get3(path_param: int): |
|
|
def get3(path_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@router.get("/get4/") |
|
|
@router.get("/get4/") |
|
|
def get4(query_param: int): |
|
|
def get4(query_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@router.post("/post2/") |
|
|
@router.post("/post2/") |
|
|
def post2(body1: Body1, body2: Body2): |
|
|
def post2(body1: Body1, body2: Body2): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
app.include_router(router) |
|
|
app.include_router(router) |
|
|
client = TestClient(app) |
|
|
client = TestClient(app) |
|
@ -121,38 +113,30 @@ def test_input_and_url_fields_with_pydanticv1(include_error_input, include_error |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
@app.get("/get1/{path_param}") |
|
|
@app.get("/get1/{path_param}") |
|
|
def get1(path_param: int): |
|
|
def get1(path_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@app.get("/get2/") |
|
|
@app.get("/get2/") |
|
|
def get2(query_param: int): |
|
|
def get2(query_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
class Body1(BaseModel): |
|
|
class Body1(BaseModel): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
class Body2(BaseModel): |
|
|
class Body2(BaseModel): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@app.post("/post1/") |
|
|
@app.post("/post1/") |
|
|
def post1(body1: Body1, body2: Body2): |
|
|
def post1(body1: Body1, body2: Body2): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
router = APIRouter( |
|
|
router = APIRouter( |
|
|
include_error_input=include_error_input, include_error_url=include_error_url |
|
|
include_error_input=include_error_input, include_error_url=include_error_url |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
@router.get("/get3/{path_param}") |
|
|
@router.get("/get3/{path_param}") |
|
|
def get3(path_param: int): |
|
|
def get3(path_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@router.get("/get4/") |
|
|
@router.get("/get4/") |
|
|
def get4(query_param: int): |
|
|
def get4(query_param: int): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
@router.post("/post2/") |
|
|
@router.post("/post2/") |
|
|
def post2(body1: Body1, body2: Body2): |
|
|
def post2(body1: Body1, body2: Body2): ... |
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
app.include_router(router) |
|
|
app.include_router(router) |
|
|
client = TestClient(app) |
|
|
client = TestClient(app) |
|
|