Closed Alc-Alc closed 1 year ago
Closing as this is the v1 pattern for DTOs.
I believe that returning an optional type from a handler is still not supported with v2 DTOs as they do a check to ensure that the type being returned from the handler is a sub-type of the dto declared data type, and an optional union isn't. LMK if you want to look at that and we can open an issue for it.
Description
DTOFactory does not seem to exclude the fields if the returned DTO is optional (
NoPassUser | None
for this example). The code works fine if the return type is just the DTO (NoPassUser
- not optional)Current Response -
password
is in the responseExpected Response -
password
should not be in the responseURL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
No response
Logs
No response
Starlite Version
1.51.7, also seems to happen on 2.0.0a2
Platform