Factory does not respect randomized collection lengths for optional collection types #403
Closed
1 of 4 tasks
Labels
bug
Something isn't working
Description
When a model has an optional collection attribute, it does not adhere to the randomized collection arguments passed to it, instead using the default length of 1 no matter what.
On a related note -- in the MCVE, removing
| None
in the type hint will correctly build with a list of random length between the min and max. However, all instances of generated data (viafactory.build()
orfactory.batch()
) have the same length. Is there a way to have variable lengths, so each subsequent call has a random, uncorrelated length?URL to code causing the issue
No response
MCVE
Output:
Steps to reproduce
See MCVE
Screenshots
No response
Logs
No response
Release Version
2.9.0
Platform
Note
Check out all issues funded or available for funding here: https://polar.sh/litestar-org
The text was updated successfully, but these errors were encountered: