We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我定义了一个R类,用于封装接口的返回对象,里面有error和data,data是泛型; 在controller中接口返回值使用 R、R,ydoc可以正常解析,但从yapi上查看的接口返回结构中User或Teacher谁在最后(swagger的definitions部分),页面展示的结构就是哪个对象的; (将ydoc生产的swagger的json提取出来发现在 defintions结构中对R中data的定义只保留1个bean(要么是Teacher要么是User),而多个接口引用R的返回就导致展示返回值问题)
public R getUser(Long uId) {} public R getTeacher(Long tId) {}
public R { private T data; ....... }
swagger json: definitions部分: "R":{"type": "object", "title": "R", "properties":{"data":{"description":"data", "$ref":"#/definitions/Teacher"}}}
接口定义部分: paths: /getUser “responses”: schema: $ref: "#/definitions/R" /getTeacher “responses”: schema: $ref: "#/definitions/R"
The text was updated successfully, but these errors were encountered:
嗯 确实只维护了一个单范型问题,这个我会解决一下
Sorry, something went wrong.
1.1.0 解决了这个问题 包已经上传 预计11.2号可以更新依赖
修复返回值泛型被覆盖的问题#12
81e546e
48bf444
No branches or pull requests
我定义了一个R类,用于封装接口的返回对象,里面有error和data,data是泛型;
在controller中接口返回值使用 R、R,ydoc可以正常解析,但从yapi上查看的接口返回结构中User或Teacher谁在最后(swagger的definitions部分),页面展示的结构就是哪个对象的;
(将ydoc生产的swagger的json提取出来发现在 defintions结构中对R中data的定义只保留1个bean(要么是Teacher要么是User),而多个接口引用R的返回就导致展示返回值问题)
public R getUser(Long uId) {}
public R getTeacher(Long tId) {}
public R {
private T data;
.......
}
swagger json:
definitions部分:
"R":{"type": "object", "title": "R", "properties":{"data":{"description":"data", "$ref":"#/definitions/Teacher"}}}
接口定义部分:
paths:
/getUser
“responses”:
schema: $ref: "#/definitions/R"
/getTeacher
“responses”:
schema: $ref: "#/definitions/R"
The text was updated successfully, but these errors were encountered: