【发布时间】:2020-10-01 11:00:34
【问题描述】:
我正在用connexion 编写一个python 服务。我可以通过localhost:<port>/ui 访问该服务的 swagger gui。但是,当我在浏览器中输入 localhost:<port> 而没有 /ui(automatically 由 connexion 添加)时,我收到以下消息:
{
"detail": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
是否可以自定义此消息?就我而言,我希望 localhost:<port> 改为返回以下消息:
{"message": "check /ui to have access to the Swagger UI"}
【问题讨论】:
标签: api rest service python-3.6 connexion