如何在Python中使用flask_restx更新名称空间的标签?

问题描述 投票:0回答:1

以下是我的示例代码。如何更新此api的标签?

import flask_restx
api = flask_restx.Namespace('example_1', description='do_something')

当我检查草签文档时,标签将使用example_1作为默认标签名称。如何在Python代码中将招摇的标记名称更新为example_2,但仍将名称空间名称保持为原始的example_1

python flask-restful flask-restplus
1个回答
0
投票

您可以为另一个标签创建另一个名称空间,请参见下面的示例

import flask_restx
api1 = flask_restx.Namespace('example_1', description='do_something')
api2 = flask_restx.Namespace('example_2', description='do_something')
© www.soinside.com 2019 - 2024. All rights reserved.