What else does it offers besides performance (switching to async is no free lunch)?
What else does it offers besides performance (switching to async is no free lunch)?
- Integrates nicely with some existing libraries (Starlette, Pydantic)
- Well documented
- Auto-validation of endpoints from data models
- Auto-generation of OpenAPI schemas from those models
- Auto-serves live API docs from that schema
- Easy definition of sync and async endpoints
Again, it was just a tiny proof-of-concept prototype, but I'm sold on using it on future projects.
Is there a package that can do a reverse? Can I give it an OpenAPI spec and get a code stump going?
Solves most of the problems for that.
Connexion [1] is built on top on Flask and does routing and validation based on an OpenAPI spec.
I've recently started developing Pyotr [2], which does the same only based on ASGI and Starlette. It also includes a client module.
[0] https://openapi-generator.tech/
class CreatePostInput(InputClass):
text: str
user_id: str
...
@handler.post('/post')
def create_post(input: CreatePostInput):
...