connexion
PythonのWebAPIフレームワーク。Flaskベースだが、Tornadoやaiohttpへ切り替えも可能。
HTTPリクエストのルーティングをOASを元に行ってくれる。
OAS駆動のWebサーバー開発ができる。
持っている機能
Swagger-ui
を使って組み込んでいる
OASによるルーティング
OASによるAPIバリデーション
リファレンス
PyPI
connexion · PyPI
Connexion - API first applications with OpenAPI/Swagger and Flask
GitHub
zalando/connexion: Swagger/OpenAPI First framework for Python on top of Flask with automatic endpoint validation & OAuth2 support
Connexion is a framework that automagically handles HTTP requests based on OpenAPI Specification (formerly known as Swagger Spec) of your API described in YAML format. Connexion allows you to write an OpenAPI specification, then maps the endpoints to your Python functions; this makes it unique, as many tools generate the specification based on your Python code. You can describe your REST API in as much detail as you want; then Connexion guarantees that it will work as you specified.
使った人のプレゼン・資料など
Spec-driven development for REST API @ PyCon JP 2020 2020/08/29
初期は良かったが、後期は実装ドリブンでOASを生成する流れになりconnexionが合わなくなってきた
Referenceでの外部のOASファイル参照をconnexionが読み込んでくれないため、1ファイルに全部書いた。辛かった。
connexion外に立てたAPI実装の呼び出しが、connexionの仕様変更でできなくなった
UIの画面
https://scrapbox.io/files/5f4b64088add8a0021324f1f.png