return { name: "auto-attr-doc", pre(this: PluginPass, file: BabelFile) { this.set("api-doc "); // 处理 path.node.leadingComments 中未处理的数据后塞到apidoc中 state.set("api-doc", apidoc }, }, post(this: PluginPass, file: BabelFile) { const apidoc = this.get("api-doc path: NodePath<t.ExportNamedDeclaration>, state: PluginPass ) { const apidoc = state.get("api-doc default, } as ApiTable); state.set("api-doc", apidoc); }, } 复制代码 2.5.4 注释解析函数: const parseComment
= "null" ]; then docker rm -f api-doc echo "停止并移除容器:"$api_doc_run_code fi image_version=`docker images | grep api-doc |awk '{print $3}' |head -n 1` if [ "$image_version" ! = "null" ]; then docker rmi $image_version echo "移除旧版镜像:"$image_version fi 查找当前运行的容器中名称包含了api-doc 对应的容器id docker ps -a | grep api-doc |awk '{print $3}' |head -n 1 查找镜像中名称包含了api-doc对应的镜像id docker images | grep api-doc |awk '{print $3}' |head -n 1 index.html 上篇中涉及到的主页的那个html 第五步,Jenkins中创建GitLab的全局认证用户
.build(); const document = SwaggerModule.createDocument(app, options); SwaggerModule.setup('api-doc ', app, document); await app.listen(3000); } bootstrap(); 接下来,我们访问 localhost:3000/api-doc/#/ (假设你的端口是 .build(); const document = SwaggerModule.createDocument(app, options); SwaggerModule.setup('api-doc
https://btc.com/api-doc https://coinmarketcap.com/api/ https://www.blockchain.com/api https://coinmarketcap.com
用例设计 1.api数据维护到api-doc,需要检查入参、出参、示例的准确性; 2.确定api是读还是写操作,读操作在prod上执行,写操作在staging执行; 3.用例设计: • 通用用例:api 用例开发 1.Test Cases新增一个用例文件,文件命名遵循api-doc的命名方式:模块_接口编号.tc,如:customer_tc9_bandwidth_country.tc。
3.3示例项目 项目地址: https://github.com/dakuohao/api-doc 三、最后 本文的思考来源于工作。
1、EOSPark API 官网: https://eospark.com/openapi 2、EOSPark API 官方文档: https://developer.eospark.com/api-doc
health logging: level: org.springframework.cloud.gateway: debug 配置 GatewaySwaggerProvider, 获取 Api-doc
author", //文档变更作者 "remarks": "desc" //变更描述 } ], "customResponseFields": [{ //自定义添加字段和注释,api-doc
4,将web版API文档另存为doc文件,即生成了api-doc文件。
author", //文档变更作者 "remarks": "desc" //变更描述 } ], "customResponseFields": [{ //自定义添加字段和注释,api-doc