Hacker News new | ask | show | jobs
by maxbond 1456 days ago
I wasn't aware of this support! That would certainly be a more natural choice if you were already familiar with Flask.

To me the biggest advantage of FastAPI is the excellent integration with type hinting. It permeates the entire framework and makes things really productive.

When I saw how you could use Pydantic models to define the schema of your request and response body, and then have that autogenerated into documentation - there was no going back. https://fastapi.tiangolo.com/tutorial/body/

But I would like to stress that, though it has displaced Flask in my workflow, I think of FastAPI as a spiritual successor to Flask, and would never say an ill word about Flask.

2 comments

I looked at Flask's docs again for the first time in a few years.

And I do miss having such industrial grade documentation for my framework. I miss it real bad.

except for the autogenerated docs, you can also make use of Pydantic in Flask easily to validate your models with Flask-Pydantic[0]

[0]: https://github.com/bauerji/flask-pydantic

I’d still choose FastAPI for its dependency framework which is so much better than the god awful ‘g’.