Skip to content

Commit

Permalink
fix: When field is enum consider left boundary as length of element a…
Browse files Browse the repository at this point in the history
…t position 0
  • Loading branch information
en-milie committed Jun 8, 2024
1 parent d884a69 commit 567bd71
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ public static long getRightBoundaryLength(Schema<?> schema) {
* @return a string smaller than Schema's minLength
*/
public static String generateLeftBoundString(Schema<?> schema) {
if (schema.getEnum() != null) {
String value = String.valueOf(schema.getEnum().get(0));
return RandomStringUtils.randomAlphanumeric(Math.max(1, value.length()));
}

int minLength = schema.getMinLength() != null ? schema.getMinLength() - 1 : 0;

if (minLength <= 0) {
Expand Down

0 comments on commit 567bd71

Please sign in to comment.