kbuntrock / openapi-maven-plugin

Generate openapi documentation for SpringMVC or JaxRS/JakartaRS projects.
https://kbuntrock.github.io/openapi-maven-plugin/
MIT License
15 stars 11 forks source link

Generic bound lists #144

Open dantheperson opened 1 month ago

dantheperson commented 1 month ago

I have a controller endpoint that takes a Dto which extends a parentDto and bind the generic list to a concrete type.

class ParentDto<T extends Foo>{ List<T> items} class ChildDto<ConcreteSubclassOfFoo> {}

this gives the dreaded java.lang.RuntimeException: Type T (+TypeVariableImpl) is not supported yet.

I'm a bit stumped as to how this one should be resolved. The old plugin we are trying to migrate away from did work with this, so it should be possible.

I've created a PR with a Unit test to reproduce.

As an aside, as a temporary workaround I've changed it resolve to Object.class in this case. Perhaps this is a good default behaviour, log a warning and resolve to Object. Better to complete with 95% detail than to not complete at all?

kbuntrock commented 1 month ago

Thank you very much @dantheperson ! Genericity resolving is the most complicated thing in this project and I'm looking for the day where 100% of cases will be handled!

I'll have a look how kongchen handled it.

And I have to think about the warning / Object resolving. It's true that this error is quite ... definitive ...

Thanks again ! 🙏