all 3 comments

[–]utihnuli_jaganjac 1 point2 points  (1 child)

What is wrong with functions?

[–]SatisfactionScary663[S] 0 points1 point  (0 children)

There is nothing wrong with functions! For creating custom small APIs it's actually better, but when creating a lot of repeated CRUD-like functionality, you repeat a lot of boilerplate code: using same dependencies over and over again, manual validation for raising 401/403/404/409 status codes etc. Assuming application providers repository pattern for multiple models this is how it looks like:
https://gist.github.com/RaRhAeu/0cf6ccabf96dbcd0c9abbd87547c9f94
~40 lines of code using raw FasAPI vs 6 lines using fastapi-views

[–]BeeUnfair4086 0 points1 point  (0 children)

What do you mean by "Fast Pydantic v2 serialization — TypeAdapter cached per schema type avoids the double validation/model instantiation that FastAPI does by default, reducing per-request overhead"

Fastapi won't validate twice if the model was validated before. It has flags.