MCPcopy Create free account
hub / github.com/alephdata/aleph / openapi

Function openapi

aleph/views/base_api.py:120–134  ·  view source on GitHub ↗

Generate an OpenAPI 3.0 documentation JSON file for the API.

()

Source from the content-addressed store, hash-verified

118
119@blueprint.route("/api/openapi.json")
120def 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")

Callers

nothing calls this directly

Calls 5

enable_cacheFunction · 0.90
get_openapi_specFunction · 0.90
jsonifyFunction · 0.90
itemsMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected