Closed ischaojie closed 2 years ago
For example:
class BookModel(BaseModel): title: str price: float @app.put("/books/<id>") @validate() def update_book(id:int, q:str, book_schema: BookModel): pass
Will auto recognize id as path param, book_schema as request body params, q as query param, just like FastAPI.
id
book_schema
q
FastAPI
I made another lib flask-valid to support this feature, using pydantic, just like FastAPI. You can pass path params, query params, and request body to view func.
pydantic
For example:
Will auto recognize
id
as path param,book_schema
as request body params,q
as query param, just likeFastAPI
.