问题描述
我正在使用Swagger记录我的项目,并且我想从springdoc生成YAML文档。但是,当我生成此YAML文档时,YAML没有Swagger文档。例如。我的项目中有一个端点:
@ApiOperation(value = "Return a list of Pix Wallets.",httpMethod = "POST",response = DResponse.class)
@PostMapping("/digital-wallet")
public ResponseEntity<DResponse> getDigitalWallets(@RequestBody PixDigitalWalletRequest pixDigitalWalletRequest) {
return ResponseEntity.ok(pixService.getDigitalWallets(pixDigitalWalletRequest));
}
当我打开草率文档时,我可以看到正确的文档:
但是...当我生成YAML文档时,我的YAML文档中没有看到我的评论(例如:“返回Pix钱包列表。”)。例如:
paths:
/api/pix/digital-wallet:
post:
tags:
- pix-controller
operationId: getDigitalWallets
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PixDigitalWalletRequest'
responses:
"200":
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/DResponse'
如何在YAML文档中添加Swagger注释?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)