Generate an OpenAPI 3.0 documentation JSON file for the API.
()
| 118 | |
| 119 | @blueprint.route("/api/openapi.json") |
| 120 | def openapi(): |
| 121 | """Generate an OpenAPI 3.0 documentation JSON file for the API.""" |
| 122 | enable_cache(vary_user=False) |
| 123 | spec = get_openapi_spec(current_app) |
| 124 | for name, view in current_app.view_functions.items(): |
| 125 | if name in ( |
| 126 | "static", |
| 127 | "base_api.openapi", |
| 128 | "base_api.api_v1_message", |
| 129 | "sessions_api.oauth_callback", |
| 130 | ): |
| 131 | continue |
| 132 | log.info("%s - %s", name, view.__qualname__) |
| 133 | spec.path(view=view) |
| 134 | return jsonify(spec.to_dict()) |
| 135 | |
| 136 | |
| 137 | @blueprint.route("/api/2/statistics") |
nothing calls this directly
no test coverage detected