如何出口烧瓶restplus swagger json?

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

我试图将我的烧瓶restplus json格式导出到文本文件.txt我检查此文档https://flask-restplus.readthedocs.io/en/0.8.0/export.html

No handlers could be found for logger "flask_restplus.api"
{u'error': u'Unable to render schema'}

但我得到上面的错误,我做错了什么?或者我应该设置什么?

我的代码很简单

from flask import json
from my_appication import api
print api.__schema__
python json flask flask-restplus
1个回答
2
投票

在另一个地方找到了这个,但我也值得在这里找到它。

import os
import json
from my_appication import api
from my_appication import app

app.config["SERVER_NAME"] = "localhost"
app.app_context().__enter__()
print(json.dumps(api.__schema__, indent=2))
© www.soinside.com 2019 - 2024. All rights reserved.