예제 #1
0
def openapi():
    """Generate an OpenAPI 3.0 documentation JSON file for the API."""
    spec = get_openapi_spec(current_app)
    for name, view in current_app.view_functions.items():
        if name in ('static', 'base_api.openapi', 'base_api.api_v1_message',
                    'sessions_api.oauth_callback'):
            continue
        log.info('%s - %s', name, view.__qualname__)
        spec.path(view=view)
    return jsonify(spec.to_dict())
예제 #2
0
def openapi():
    """Generate an OpenAPI 3.0 documentation JSON file for the API."""
    enable_cache(vary_user=False)
    spec = get_openapi_spec(current_app)
    for name, view in current_app.view_functions.items():
        if name in (
                "static",
                "base_api.openapi",
                "base_api.api_v1_message",
                "sessions_api.oauth_callback",
        ):
            continue
        log.info("%s - %s", name, view.__qualname__)
        spec.path(view=view)
    return jsonify(spec.to_dict())