igorbenav / fastcrud

FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities.
MIT License
617 stars 43 forks source link

Can the response format be standardized? #137

Open fzbird opened 1 month ago

fzbird commented 1 month ago

Can the response format be standardized? When I use crud_router in FastAPI+SQLAlchemy+MySQL, the returned message data is inconsistent, which can easily cause front-end call discrimination and processing. For example, when updating, if the ID does not exist, crud_router does not return an error message. When deleting an ID object that does not exist, the backend will report an error, which will cause unpredictable problems in the front-end and back-end. However, fastapi_crudrouter seems to handle this well, but in terms of flexibility and adaptability to new environments, fastcrud is definitely better. At this point, I would like to ask if the author is willing to unify and improve the response format and some error handling.

igorbenav commented 1 month ago

This can be done. We'll get to it eventually, but you can tackle it if you want