init_apispec.py 682 Bytes
Newer Older
Weizhi Cui's avatar
Weizhi Cui committed
1 2 3 4 5 6 7 8 9
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version     : Python 3.11.4
# @Software    : Sublime Text 4
# @Author      : StudentCWZ
# @Email       : StudentCWZ@outlook.com
# @Date        : 2023/10/29 12:01
# @File        : init_apispec.py
崔为之's avatar
崔为之 committed
10
# @Description : Initializes the FlaskApiSpec extension for a Flask application.
Weizhi Cui's avatar
Weizhi Cui committed
11 12 13 14 15
"""

from flask import Flask
from flask_apispec import FlaskApiSpec

崔为之's avatar
崔为之 committed
16
# Initialize FlaskApiSpec
Weizhi Cui's avatar
Weizhi Cui committed
17 18 19 20 21
apispec = FlaskApiSpec()


def init_apispec(app: Flask) -> None:
    """
崔为之's avatar
崔为之 committed
22
    Initializes the FlaskApiSpec extension for a Flask application.
Weizhi Cui's avatar
Weizhi Cui committed
23

崔为之's avatar
崔为之 committed
24 25 26 27 28
    Args:
        app (Flask): The Flask application.

    Returns:
        None
Weizhi Cui's avatar
Weizhi Cui committed
29 30
    """
    apispec.init_app(app)