From c9e4031c02ec5015bb39f17aeb72e8f417b06fb0 Mon Sep 17 00:00:00 2001 From: Nicholas Rodrigues Lordello Date: Thu, 12 May 2022 15:08:31 +0200 Subject: [PATCH] Manually parse body --- src/_server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/_server.py b/src/_server.py index 570874b..315c3ce 100644 --- a/src/_server.py +++ b/src/_server.py @@ -54,9 +54,12 @@ def health() -> bool: @app.post("/solve", response_model=SettledBatchAuctionModel) -async def solve(problem: BatchAuctionModel, request: Request): # type: ignore +async def solve(request: Request): # type: ignore """API POST solve endpoint handler""" - logging.debug(f"Received solve request {await request.json()}") + body = await request.json(); + logging.debug(f"Received solve request {body}") + + problem = BatchAuctionModel(**body) solver_args = SolverArgs.from_request(request=request, meta=problem.metadata) batch = BatchAuction.from_dict(problem.dict(), solver_args.instance_name)