Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

接口比较多,没办法创建两个接口文档 #13

Open
FiveMeter opened this issue Feb 23, 2023 · 1 comment
Open

接口比较多,没办法创建两个接口文档 #13

FiveMeter opened this issue Feb 23, 2023 · 1 comment

Comments

@FiveMeter
Copy link

AssertionError: A name collision occurred between blueprints <flask.blueprints.Blueprint object at 0x7f9ea0a14cc0> and <flask.blueprints.Blueprint object at 0x7f9ea0a149b0>. Both share the same name "siwadoc". Blueprints that are created on the fly need unique names.

@FiveMeter FiveMeter changed the title 接口比较多,没办法创建两个路由的接口文档 接口比较多,没办法创建两个接口文档 Feb 23, 2023
@Shone1214
Copy link

新建一个文件context用于存储,用的时候再取出来

def create_app(settings):
    app = Flask(__name__)
    context['app'] = app
    context['siwa'] = SiwaDoc(app, doc_url='/docs', openapi_url='/openapi.json',  title="test", description="test")
from ..context import context

siwa = context.get('siwa')

@siwa.doc()
# 定义接口

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants