Bug: Using plugin results in DTO given to dto parameter not being used for return #3460
Open
1 of 4 tasks
Labels
Bug 🐛
This is something that is not working as expected
Description
Based on the docs, I expect a DTO given to a handler via the
dto
parameter to apply to the return value when noreturn_dto
is specified. However, when theSQLALchemyPlugin
is used this is not the case.More generally, it looks like the
return_dto
resolution order in theBaseRouteHandler
puts generated DTOs from serialization plugins ahead of DTOs from explicitdto
parameters on the handler. For me this is not the expected behavior based on the documentation, though I can see that one may want to opt-in to thereturn_dto
provided by the plugin while still providing a data DTO, which perhaps is the reason for the current behavior.It may be that the docs just need an update to clarify? An alternative might be to specify a particular value that can be passed to the
return_dto
parameter to maintain the current behavior, but to otherwise resolve todto
if it's given.URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
Logs
Litestar Version
2.8.2
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: