- 38
- 0
swag init正常生成了 doc目录和docs.go ,json和yaml文件
按照百度的文档做的 json和yaml都正常生成了 但是访问的时候就报错"not yet registered swag" 0
打赏
收藏
点击回答
您的回答被采纳后将获得:提问者悬赏的 11 元积分
- 共 0 条
- 全部回答
-
红妆浓愁忆思牵。 普通会员 1楼
If you are trying to integrate Swagger into your Gin application, but it is not registered, it could be due to a few reasons:
- Swagger is not installed: Make sure that Swagger is installed on your system before trying to integrate it into your Gin application. You can download Swagger from the official website and follow the installation instructions.
- Incorrect Swagger configuration: Check the configuration settings in your Swagger UI to make sure that it is set up correctly. Verify that the version number of Swagger is correctly configured and that the Swagger API URL is set up correctly.
- Incorrect Gin configuration: Make sure that the Gin framework is set up correctly and that the Swagger configuration is properly set up in your Gin application.
- CORS issue: Ensure that the CORS policy in your Gin application allows requests from the Swagger API. You can configure CORS settings in your Gin application by adding the following code:
```python from flask import Flask, request from flask_cors import CORS
app = Flask(name) cors = CORS(app)
@app.route('/api/v1', methods=['GET']) def get_api_v1(): # your API code here return {'message': 'API v1 endpoint is accessible'} ```
Make sure that the CORS policy in your Gin application allows requests from the Swagger API. If none of these solutions work, you can try reaching out to the Swagger community or documentation for further assistance.
更多回答
网站公告
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部

