Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern string sampler does not take into account minLength property #216

Closed
ostridm opened this issue Sep 25, 2023 · 0 comments · Fixed by #217
Closed

Pattern string sampler does not take into account minLength property #216

ostridm opened this issue Sep 25, 2023 · 0 comments · Fixed by #217
Assignees
Labels
Type: bug Something isn't working.

Comments

@ostridm
Copy link
Contributor

ostridm commented Sep 25, 2023

Description

Pattern string sampler does not take into account the minLength property and produce an unexpected error while string is being sampled.

Steps to reproduce

Pass the schema to sample as follows:

sample({
  type: 'string',
  format: 'pattern',
  maxLength: 4,
  minLength: 4,
  pattern: '^[0-9]+$'});

Actual result

Error reported:

Sample string cannot be generated by boundaries: minLength=4, maxLength=4, format=pattern

Expected result

Sample value generated successfully

   4444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant