r/programming • u/Holiday_Serve9696 • Aug 02 '25
How FastAPI Works
https://fastlaunchapi.dev/blog/how-fastapi-works/[removed]
118
Upvotes
r/programming • u/Holiday_Serve9696 • Aug 02 '25
[removed]
View all comments
Show parent comment
0
u/Big_Combination9890 Aug 03 '25
Wrong.
https://fastapi.tiangolo.com/tutorial/body/#without-pydantic
And I hardly think this is less boilerplate.
There. Wow, 2 whole lines of code.
And yes, this gets more complex for more intricate types. I am fully aware that Go isn't as simple as python. But for most things it is similar enough that it doesn't matter. And in the few instances when I actually need more complex type validation, well, let's just say that generative AI is really good at writing this boilerplate for me.
Of course you can, that's one of the advantages of working i a class with dynamic typing; you can build much slimmer and expressive validation systems in it.
The flip side is that, well, you work in a dynamically typed language, and while pythons typing has come a long way, it still has a lot of problems, edge cases, and sometimes really bad notation issues (just look at this for an example).