Skip to content
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

swagger 接口文档问题 #639

Open
zhangle910522 opened this issue Aug 25, 2024 · 5 comments
Open

swagger 接口文档问题 #639

zhangle910522 opened this issue Aug 25, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@zhangle910522
Copy link

拉取Master代码之后 访问 http://localhost:48080/doc.html
发现所有的接口生成的文档都是 content-type:application/x-www-form-urlencoded 提交请求报 500错误
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:211)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:160)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:133)
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:122)
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:179)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:146)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)

image
@zhangle910522
Copy link
Author

为啥不是 json?

@zhangle910522
Copy link
Author

image 导入到 apifox 之后 Content-Type 也不是application/json

@sing173
Copy link

sing173 commented Aug 28, 2024

同样问题,希望尽快解决

@YunaiV
Copy link
Owner

YunaiV commented Aug 31, 2024

master-jdk17 解决了,这个是 knife4j 的 bug。。。

https://t.zsxq.com/Urhsr 星球也有人反馈类似问题。

https://doc.iocoder.cn/api-doc/ 这里我解释了下原因。。。

= = 很尴尬

@YunaiV YunaiV closed this as completed Aug 31, 2024
@YunaiV YunaiV self-assigned this Aug 31, 2024
@YunaiV YunaiV added the bug Something isn't working label Aug 31, 2024
@D2Moqi
Copy link

D2Moqi commented Oct 28, 2024

修改接口文档依赖 <springdoc.version>1.8.0</springdoc.version> 和 关闭 knife4j.enable 增强模式 后可以正常使用。参考:https://blog.csdn.net/qq_39609993/article/details/141873658

@YunaiV YunaiV reopened this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants