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

generics hell question #27

Open
oradkovsky opened this issue Aug 2, 2022 · 1 comment
Open

generics hell question #27

oradkovsky opened this issue Aug 2, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@oradkovsky
Copy link
Contributor

hello! Please consider this as question.

Assuming we ended up with strange modelling like this one Model1<Model2<Model3>>, present day version of JsonXConverterFactory, namely responseBodyConverter, will crash here type.actualTypeArguments.first() as Class<*> (because first() is also ParameterizedType, which, can go on and on)

Question: is it bug or feature? :) Clearly, this can be bypassed and surely this kind of modelling is bad in the first place, so I'm just curious about "creators intent" here.

@stjepanbanek
Copy link
Contributor

@oradkovsky this is a good point! To be honest, we didn't intend to support nested generics, but we will definitely consider it for the future updates.
Even though modelling a n-depth generic class is probably a bad idea, this could be solved in the library by using some recursive approach.

I will make sure to add this to our to-do list for the next release. Thank you very much for your feedback!

@stjepanbanek stjepanbanek added the enhancement New feature or request label Aug 5, 2022
@stjepanbanek stjepanbanek self-assigned this Aug 5, 2022
@stjepanbanek stjepanbanek reopened this Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants