swagger-codegen - 如何在 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 生成它并将responseWrapper
Spring Server Stub 的配置留空。但我怀疑正在应用默认值。我查看了 Swagger Codegen 源,找不到指定“NONE”的方法。
解决方案
推荐阅读
- python - 无法从“多处理”导入名称“进程”
- ios - 不同 controlStates 的 ASButtonNode 属性标题
- python - 如何从 Python 中的 FIGARCH 模型中获得条件均值和标准差?
- eclipse - 如何在 Eclipse 插件中识别 ProgressMonitor 的完成状态?
- sql-server - 如何为 F# SqlProgrammabilityProvider 调用存储过程使用本地架构
- javascript - 如何详细说明正则表达式以仅显示文件扩展名之后的第一个问号之前的最后一个斜杠之后的字符?
- nativescript-vue - 这行“render: h => h('Frame', [ h(App) ])” 有什么作用?
- sql - 使用连接语句的 DB2 更新查询
- algorithm - 查找与输入数组有最大交集的数组的有效方法
- qt - Qt 中事件的默认优先级