mongodb-labs / full-stack-fastapi-mongodb

Full stack, modern web application generator. Using FastAPI, MongoDB as database, Docker, automatic HTTPS and more.
MIT License
453 stars 80 forks source link

fix: Corrected exclude parameter to accept valid arguments #35

Closed IgorFreitasCruz closed 5 months ago

IgorFreitasCruz commented 5 months ago

In the /backend/app/app/schemas/base_schema.py I found what is likely to be an error in the as_db_dict property of BaseSchema class. In the set literal {"identifier, id"} the correct syntax should probably use two separate strings in the set: {"identifier", "id"}. I did local tests and it seems not to affect the properties end result because the key "identifier" is overwritten anyway in this case. But model_dump() outputs a different result when using two separated string, ie: excluding the key "identifier" from the dumped model.