如何解决Swagger Codegen Spring服务器存根中如何没有responseWrapper
我希望Swagger Codegen在没有响应包装的情况下生成Delegate接口:
这是生成的内容(删除了无关的内容):
public interface MyApi {
MyApiDelegate getDelegate();
default ResponseEntity<NotificationEntity> httpGetUsingGET(...) {
...
}
这就是我希望生成的内容(请注意;没有ResponseEntity
包装器:
default NotificationEntity httpGetUsingGET(...)
这是输入的Swagger规范
'/api/notification/{encryptedId}':
get:
tags:
- Notifications
summary: Get a specific NotificationModel
operationId: httpGetUsingGET
produces:
- application/json
parameters:
- name: encryptedId
in: path
description: encryptedId
required: true
type: string
responses:
'200':
description: OK
schema:
$ref: '#/definitions/NotificationEntity'
我并不是不喜欢响应包装的想法。就是现有的代码库只返回没有包装的实体。
我正在使用SwaggerHub生成此文件,并将Spring Server Stub的responseWrapper
配置保留为空白。但我怀疑正在应用默认设置。我浏览了Swagger Codegen的源代码,找不到指定“ NONE”的方法。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。