Closed arbejd closed 1 year ago
It's indeed possible that fieldGeneration
has not been implemented for enums.
I'll tag this as a bug
I have no time to fix this right now, but feel free to open a pull request. Or maybe @emab if you want to check it out?
I'll look into this when I have minute.
I would have thought this should work but potentially the enum auto generation is taking precedence.
I've just opened a PR which should allow this to work @arbejd but worth noting that you'll need to pass in your arguments like this:
fieldGeneration: {
User: {
userStatus: {
generator: 'helpers.arrayElement',
arguments: [['active', 'disabled']],
},
...
}
Note the double arrays - this ensures the array is passed in as the argument to helpers.arrayElement
.
Thank you folks for an excellent plugin!
Im having some difficulty in dynamically handling enums. I got an enum
that i want to mock dynamically so its just picked at random, but this does nothing for me:
No matter what generator i use it seems i cant override the definition that it just takes the first of the enums always.
Any hints?