I want to use slowapi on a fastapi python app, for implementing RateLimiter. However, The definitions of the endpoints use a data model for parameters (inheriting from BaseModel) rather than a request, as the documentation of slowapi require. here is a sample endpoint from the code:
@app.post("/process_user")
def process_user(
params: NewUser,
pwd: str = Depends(authenticate),
):
where NewUser is the data model
class NewUser(BaseModel):
...
How can I add a slowapi rate limiter with minimum change of the design of the code?
Thanks.