[英]Swagger-codegen flask generated server locally doesn't works
I have generated a simple API server example using swaggerhub, and downloaded python-flask generated server locally.我使用 swaggerhub 生成了一个简单的 API 服务器示例,并在本地下载了 python-flask 生成的服务器。
Unfortunately, it seems to not work at all.不幸的是,它似乎根本不起作用。 Every time I try to access the indicated url, that is
每次尝试访问指示的url,即
http://localhost:8080/data/2.5//ui/ http://localhost:8080/data/2.5//ui/
it returns me a 404 error.它返回一个 404 错误。
I've tried all the solutions reported on:我已经尝试了所有报告的解决方案:
Python connexion not displaying Swagger UI Python 连接不显示 Swagger UI
but with no success.但没有成功。 What am I missing?
我错过了什么?
A very simple detail that made all work: after executing pip install 'connexion[swagger-ui]'
and pip install pathlib swagger_ui_bundle
(though I am not sure the last is strictly needed...), the server worked only with an invalidate cache and restart command on PyCharm.一个非常简单的细节使所有工作正常:在执行
pip install 'connexion[swagger-ui]'
和pip install pathlib swagger_ui_bundle
(虽然我不确定最后一个是否是严格需要的......),服务器仅使用无效缓存工作并在 PyCharm 上重新启动命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.