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

Converting ParameterizedType #73

Open
ZKGanancial opened this issue Jun 27, 2019 · 0 comments
Open

Converting ParameterizedType #73

ZKGanancial opened this issue Jun 27, 2019 · 0 comments
Labels

Comments

@ZKGanancial
Copy link

ZKGanancial commented Jun 27, 2019

Using the JspoonRetrofitConverter only works for Call< TypedResponseClass > e.g. Response< TypedClass > however when I have a generic type such as ApiResponse< T > which would correspond to a response object of Response< ApiResponse< T > >, ClassCastException occurs.

specifically in line 30 of JspoonConverterFactory.java because of the Class< ? > casting.

 return new JspoonResponseBodyConverter<>(retrofit.baseUrl(),
            jspoon.adapter((Class<?>) type));

Is it possible to also change the code such as Parameterized types e.g. ApiResponse< T > can also generate an appropriate converter? Basically if it is a Parameterized type, I want the corresponding converter for < T >.

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

No branches or pull requests

2 participants