Closed nchaikh closed 3 months ago
This is not a bug. It's just how generics work in Python.
When you do GenericController[AuthorModel, AuthorService]
, the Model
type var won't automagically be replaced behind the scenes with AuthorModel
. This would require the subclass to create a deep copy of the generic base class, with all the type var's usages substituted with the type you passed.
There is a feature request to support generic controllers: #1311
Description
I´ve been trying to do a generic controller, something like DRF generic Views. The controller works but in the OpenAPI docs the models of the controller don't generate.
URL to code causing the issue
No response
MCVE
Steps to reproduce
No response
Screenshots
Logs
No response
Litestar Version
2.10.0
Platform