springdoc / springdoc-openapi

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
3.29k stars 499 forks source link

open default-flat-param-object: true is error : StackOverflowError #2372

Closed lexang closed 1 year ago

lexang commented 1 year ago

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.StackOverflowError at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1087) 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.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:497) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:584)

Caused by: java.lang.StackOverflowError: null at com.fasterxml.jackson.databind.type.TypeFactory._findWellKnownSimple(TypeFactory.java:1343) at com.fasterxml.jackson.databind.type.TypeFactory._fromClass(TypeFactory.java:1429) at com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1373) at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:734) at io.swagger.v3.core.util.PrimitiveType.fromType(PrimitiveType.java:347) at org.springdoc.core.MethodParameterPojoExtractor.isSwaggerPrimitiveType(MethodParameterPojoExtractor.java:249) at org.springdoc.core.MethodParameterPojoExtractor.lambda$isSimpleType$10(MethodParameterPojoExtractor.java:238) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499) at org.springdoc.core.MethodParameterPojoExtractor.isSimpleType(MethodParameterPojoExtractor.java:238) at org.springdoc.core.MethodParameterPojoExtractor.fromGetterOfField(MethodParameterPojoExtractor.java:140) at org.springdoc.core.MethodParameterPojoExtractor.lambda$extractFrom$1(MethodParameterPojoExtractor.java:122)

springdoc-openapi:1.7.0 springboot 2.7.14

lexang commented 1 year ago

运行了下 研究了下源码 看是到extends Model继承了mybatisplus的Model的类会报错,继承了mybatisplus的Model的类有什么办法解决吗 是不是继承的类都不行 有什么办法解决

uc4w6c commented 1 year ago

Please provide a Minimal, Reproducible Example - with HelloController that reproduces the issue.

This ticket will be closed and can be reopened if the relevant information are provided.

sys613 commented 4 months ago

我也遇到这个问题了 是直接改了吗