You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
For some time we have been using this library at my company, and the dot notation for nested field setting on subfactories has proven really useful. It make really the declaration of new instances with fixed data really elegant.
Now, I think a similar strategy could be carried over for slice nested fields.
If you like the idea, I could PR it myself.
Intro
Hi!
For some time we have been using this library at my company, and the dot notation for nested field setting on subfactories has proven really useful. It make really the declaration of new instances with fixed data really elegant.
Now, I think a similar strategy could be carried over for slice nested fields.
If you like the idea, I could PR it myself.
Example
Context
For example (borrowed from our codebase):
our factories look like:
Proposal:
My proposal would work like this:
Scenario 1: Dot notation for nested array fields
would affect all slice generated instances, printing something like
Scenario 2: Dot notation for nested array fields on specific index in slice subfactory bounds
would affect only the instance generated at the specified index, printing something like
Scenario 3: Dot notation for nested array fields on specific index out of slice subfactory bounds
would panic with an error.
The text was updated successfully, but these errors were encountered: