- Use TypedDict (or typed Motor collections) for repository/DB-layer static typing.
- Use Pydantic models for API input/output and runtime validation.
- Keep DB schemas and API schemas separate.
Why this split works:
- TypedDict gives better autocomplete and mypy/pyright checks in DB code.
- Pydantic enforces runtime correctness (types, coercion, constraints).
- Mongo docs often include internal fields (_id, audit fields, partial projections) that should not leak to API models.
So: typed DB docs improve developer ergonomics, while separate Pydantic schemas improve correctness and boundary hygiene. This
hybrid is usually the strongest setup.
the creation should still work with fasterapi make-schema nothing seperate if at all something seperate should exist the thing is to create db schema's not even doing a seperate thing just to upgrade depracated stuff to allow them gain the benefits of a staticly typed database schema
Why this split works:
So: typed DB docs improve developer ergonomics, while separate Pydantic schemas improve correctness and boundary hygiene. This
hybrid is usually the strongest setup.
the creation should still work with fasterapi make-schema nothing seperate if at all something seperate should exist the thing is to create db schema's not even doing a seperate thing just to upgrade depracated stuff to allow them gain the benefits of a staticly typed database schema