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
Swagger2Controller.getDocumentation get IndexOutOfBoundsException #1129
Comments
Could you provide a stacktrace? |
2016-01-07 18:47:16,073 ERROR [http-nio-8080-exec-13#101] <com.huawei.iom.component.base.exception.ExceptionHandler.resolveException,117> - java.lang.IndexOutOfBoundsException: Index: 1 发件人: Dilip Krishnan [mailto:notifications@github.com] Could you provide a stacktrace? — |
Also from which library are you using |
We use two kinds json library, both not work, net.sf.json.JSONObject; and com.fasterxml.jackson.databind.node.ObjectNode in springfox 2.2.2, they will be treat object "body": { In swagger ui, it show “{}” 发件人: Dilip Krishnan [mailto:notifications@github.com] Also from which library are you using JSONObject? Could you provide the class definition of the model that has this type perhaps? — |
@yqzhan2014 Out of curiosity, what version of |
I am getting same issue when I am trying to hit swagger-ui.html page in browser? java.lang.IndexOutOfBoundsException: Index: 1 Please help me. Should I change swagger version to 2.6.1 |
I am using 2.4.0, which have solved my previous problem.
发件人: Sachin Nikam [mailto:notifications@github.com]
发送时间: 2016年12月1日 19:10
收件人: springfox/springfox
抄送: Zhanyongqiang; Mention
主题: Re: [springfox/springfox] Swagger2Controller.getDocumentation get IndexOutOfBoundsException (#1129)
I am getting same issue when I am trying to hit swagger-ui.html page in browser?
java.lang.IndexOutOfBoundsException: Index: 1
at java.util.Collections$EmptyList.get(Collections.java:4454)
at springfox.documentation.swagger2.mappers.ModelMapper.typeOfValue(ModelMapper.java:129)
at springfox.documentation.swagger2.mappers.ModelMapper.mapProperties(ModelMapper.java:92)
at springfox.documentation.swagger2.mappers.ModelMapper.mapModels(ModelMapper.java:67)
at springfox.documentation.swagger2.mappers.ModelMapper.modelsFromApiListings(ModelMapper.java:205)
at springfox.documentation.swagger2.mappers.ServiceModelToSwagger2MapperImpl.mapDocumentation(ServiceModelToSwagger2MapperImpl.java:50)
at springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(Swagger2Controller.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
..............
..............
Please help me. Should I change swagger version to 2.6.1
I am using 2.5.0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1129 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHwb6BF_pF_tC63FNT3UD3BVemeM7bdUks5rDqskgaJpZM4HAVAc>.
|
In 2.2.2 version it's OK, but when upgrade to 2.3.1(or 2.3.0), i got a IndexOutOfBoundsException.
I finally find in my rest API request DTO, if exist a filed "JSONObject", it will happen.
If delete it, it's OK. Why? Is there some change about this?
The text was updated successfully, but these errors were encountered: