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 maxLength property #208

Closed
ostridm opened this issue Sep 14, 2023 · 0 comments · Fixed by #209
Closed

Pattern string sampler does not take into account maxLength property #208

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

Comments

@ostridm
Copy link
Contributor

ostridm commented Sep 14, 2023

Description

Pattern string sampler does not take into account the maxLength property and produce an unexpected error

Steps to reproduce

Pass the schema to sample as follows:

sample({
  type: 'string',
  format: 'pattern',
  pattern: '^[A-Z0-9]*$',
  maxLength: 10});

Actual result

Error reported:

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

Expected result

Sample value generated successfully

   RRRRR
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