当前位置:网站首页>Swag init error: cannot find type definition: response Response
Swag init error: cannot find type definition: response Response
2022-07-01 09:35:00 【lsjweiyi】
Method source :https://www.jianshu.com/p/1837b37e03f8
go-admin The framework is configured with swagger Of , But when I changed the content , After adding your own excuse , Want to generate new swagger file , But it was wrong. :
ParseComment error in file xxx :cannot find type definition: response.Response
Then you see the definition on the interface swagger Parameters :
// ServerInfo Get system information
// @Summary system information
// @Description obtain JSON
// @Tags system information
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/server-monitor [get]
// @Security Bearer
there
@Success 200 {object} response.Response “{“code”: 200, “data”: […]}”
response.Response It's external dependence :“github.com/go-admin-team/go-admin-core/sdk/pkg/response”
In the project , I see that the dependency has been introduced :
import (
_ "github.com/go-admin-team/go-admin-core/sdk/pkg/response"
)
Because the dependency is not actually applied , So use a bar to comment out , But it initializes , That's enough .
Search findings , Originally, we had to add parameters , To identify external dependencies :
swag init --parseDependency --parseInternal
PS : I found out later , original go-admin They are ready , stay main.go in :
vs code With plug-ins , Direct point ”run go generate“ that will do
边栏推荐
- OSPF - virtual link details (including configuration commands)
- ES6-const本质与完全不可改实现(Object.freeze)
- tensorrt yolov5_ trt. Py comments
- 【ESP 保姆级教程 预告】疯狂Node.js服务器篇 ——案例:ESP8266 + DHT11 +NodeJs本地服务+ MySQL数据库
- Analysis and solution of JS this loss
- 121. thread scheduling: join() method and yield() method
- PHP array functions (merge, split, append, find, delete, etc.)
- Day06 branch structure and cycle (III)
- 2.4 activation function
- node. How to implement the SQL statement after JS connects to the database?
猜你喜欢
![delete和delete[]引发的问题](/img/d9/a1c3e5ce51ef1be366a973aa42d1f0.png)
delete和delete[]引发的问题

【pytorch】2.4 卷积函数 nn.conv2d

集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常

Principle and application of single chip microcomputer timer, serial communication and interrupt system

Tree structure -- binary tree 2 non recursive traversal

Principles of Microcomputer - Introduction

计网01-物理层

Learning practice: comprehensive application of cycle and branch structure (II)

Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)

Structure de l'arbre - - - arbre binaire 2 traversée non récursive
随机推荐
ESP8266 FreeRTOS开发环境搭建
Spark's action operator
类加载
SQL learning notes (04) - data update and query operations
[interview brush 101] linked list
JS原型链
Unity tips for reducing the amount of code -- empty protection extension
UE small knowledge point controller possess pawn process
js变量提升(hoisting)
JS prototype trap
SQL learning notes (03) -- data constraint relationship
123. how to stop a thread?
华为帐号多端协同,打造美好互联生活
Solution of EPS image blur by latex insertion
Differences between JS valueof and toString
【pytorch】transforms. Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
Tree structure -- binary tree 2 non recursive traversal
The market is relatively weak recently
利用闭包实现私有变量