igorbenav / fastcrud

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

Adding Response Model - Return Type #113

Open otabek-olimjonov opened 1 week ago

otabek-olimjonov commented 1 week ago

It would be great to include response model in crud_router like

users_router = crud_router( session=get_session, model=User, create_schema=schemas.UserCreate, update_schema=schemas.UserUpdate, response_schema=schemas.UserResponse ## this feature request )

JakNowy commented 6 days ago

It is supported on the CRUD level with schema_to_select parameter, but not in the router itself, which is still a bit underdeveloped. It should be added to EndpointCreator and passed here. Should be fairly simple, feel free to open a PR with that, otherwise we'll work on that later on!