Bug: return_dto
with optional nested Struct
field raises 500 error when no default exists
#3785
Open
1 of 4 tasks
Labels
Bug 🐛
This is something that is not working as expected
Description
I read through every open bug and couldn't find something directly comparable (though in general it seems like nested objects in DTOs is a recurring source of issues).
The crux is that I don't want to provide a default for the
None
case of a field because I want to explicitly set it, even if it'sNone
. That works fine if the field is a simple type likestr
but when it's a nested type like aStruct
of its own then an error appears statingTypeError: Missing required argument
even when the argument is provided.URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
No response
Logs
Litestar Version
2.12.1
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: