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

Gernerics Related to Bug #146 and #174 #235

Open
Valdur5 opened this issue May 24, 2017 · 2 comments
Open

Gernerics Related to Bug #146 and #174 #235

Valdur5 opened this issue May 24, 2017 · 2 comments

Comments

@Valdur5
Copy link

Valdur5 commented May 24, 2017

Hello,

thanks for providing such a cool documentation framework it works well but one really big thing is still broken, different people described the same problem in Issue 146 and 174.

I want to return a generic List because I don't want to build for every object a wrapper object just for some HATEOAS extra fields. Thats why I want to return a generic Array like this:

public @ApiResponseObject()
ItemCollection getAllMountains() {

I am using JSONdoc 1.2.17

And here is the dump (part of)

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:112) ~[jsondoc-springmvc-1.2.17.jar:na]
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.appendSubCandidates(AbstractSpringJSONDocScanner.java:168) ~[jsondoc-springmvc-1.2.17.jar:na]
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.jsondocObjects(AbstractSpringJSONDocScanner.java:200) ~[jsondoc-springmvc-1.2.17.jar:na]
at org.jsondoc.core.scanner.AbstractJSONDocScanner.getJSONDoc(AbstractJSONDocScanner.java:96) ~[jsondoc-core-1.2.17.jar:na]
at org.jsondoc.springmvc.controller.JSONDocController.getApi(JSONDocController.java:70) ~[jsondoc-springmvc-1.2.17.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]

@maxmumford
Copy link

maxmumford commented Jun 26, 2017

Can confirm this bug still exists at 1.2.17.

@ST-DDT
Copy link

ST-DDT commented Sep 26, 2017

Duplicate of #226 (A fix is described there too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants