【发布时间】:2019-11-27 14:23:16
【问题描述】:
我正在使用OpenApi v3.3.4(以前称为Swagger CodeGen)maven 插件通过api.yml 文件生成我的rest 控制器,其中我描述了我想要公开的所有操作。
在我的用例中,我想公开一个方法 POST: handleNotification(@RequestBody SignatureNotification notification),它的请求主体的类型是通过 /targer 文件夹中的另一个 maven-plugin 生成的。
实际上,我在 .yml 文件的 Componentspart 中定义了 SignatureNotification:
...
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SignatureNotification'
...
由 OpenApi 插件生成,然后我将其映射到已经存在且具有相同属性的 SignatureNotification。
我对这个解决方案不是很满意,所以我想知道是否有办法告诉 OpenApi Generator 使用外部对象作为参考?
【问题讨论】:
标签: swagger-codegen openapi-generator