Skip to content

Commit

Permalink
Manually parse body
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Rodrigues Lordello committed May 12, 2022
1 parent 8ebe252 commit c9e4031
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c9e4031

Please sign in to comment.