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
This checks if the tag contains the word len, its contents is split by using an equal sign as separator.
It throws an error if this fails.
In our specific case we use a oneof in our tag. One of the possible options is 'Bedrijfsmatig handelen'.
This text contains the word len so faker thinks this must be something like len=10, but it's not.
So our unit tests and app fail.
Note also the word 'lang' could be part of a oneof, so should also be mitigated.
I think extending the checks with && !isOneOfTag could work.
Could you please have a look at it?
Regards,
Ton
The text was updated successfully, but these errors were encountered:
threehook
changed the title
Checking 'len' and 'lang' in a tag could lead to problem using a oneof
Checking 'len' and 'lang' in a tag could lead to problems using a oneof
Dec 14, 2022
Hi,
I found a bug in faker.go.
In function
extractStringFromTag
there is the following code:This checks if the tag contains the word
len
, its contents is split by using an equal sign as separator.It throws an error if this fails.
In our specific case we use a oneof in our tag. One of the possible options is 'Bedrijfsmatig handelen'.
This text contains the word
len
so faker thinks this must be something likelen=10
, but it's not.So our unit tests and app fail.
Note also the word 'lang' could be part of a oneof, so should also be mitigated.
I think extending the checks with && !isOneOfTag could work.
Could you please have a look at it?
Regards,
Ton
The text was updated successfully, but these errors were encountered: