Api 自定义访问connexion(python)服务的服务器url时返回的消息
我正在用编写一个python服务。我可以通过Api 自定义访问connexion(python)服务的服务器url时返回的消息,api,rest,service,python-3.6,connexion,Api,Rest,Service,Python 3.6,Connexion,我正在用编写一个python服务。我可以通过localhost:/ui访问服务的招摇过市gui。但是,当我在没有/ui(由connexion添加)的浏览器中输入localhost:时,我会收到以下消息: { "detail": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try agai
localhost:/ui
访问服务的招摇过市gui。但是,当我在没有/ui
(由connexion添加)的浏览器中输入localhost:
时,我会收到以下消息:
{
"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:
返回以下消息:
{"message": "check /ui to have access to the Swagger UI"}
我想我找到了解决办法。只需将以下内容添加到openspec api中:
/:
get:
operationId: path.to.function
summary: "my personlized message"
responses:
......