-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
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
返回ModelAndView 类型的接口 无法被扫描到接口文档 #6697
Comments
ModelAndView在spring web的定义是跳转页面使用的,如集成了themeleaf\freemarker时可以使用。swagger是用于生成纯数据接口的文档,不生成是正常的。如果需要使用使用两个方法,一个方法用于跳转页面,一个方法用于数据返回,在数据返回的方法中正常使用swagger注解并且使用@responsebody注解进行修饰。 |
但是在上面已经使用了@RestController了 |
因为 ModelAndView 是 Spring MVC 中用于返回视图和模型数据的一种方式,而 Swagger 主要关注的是 API 的 HTTP 响应体、状态码等信息,并不直接处理视图逻辑。 |
感谢!
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 发送日期 | 2024年07月31日 09:07 |
| 收件人 | jeecgboot/JeecgBoot ***@***.***> |
| 抄送人 | 莫愁 ***@***.***>,
Author ***@***.***> |
| 主题 | Re: [jeecgboot/JeecgBoot] 返回ModelAndView 类型的接口 无法被扫描到接口文档 (Issue #6697) |
因为 ModelAndView 是 Spring MVC 中用于返回视图和模型数据的一种方式,而 Swagger 主要关注的是 API 的 HTTP 响应体、状态码等信息,并不直接处理视图逻辑。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
版本号:3.7.0 springboot3
问题描述:
如果接口没有用result返回对象的话 接口文档不会扫描到这个接口的,项目也是放在org.jeecg下面,请问要怎么样才可以返回文件流切让接口文档识别出来
错误截图:
友情提示:
The text was updated successfully, but these errors were encountered: