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

feat(msw): take string pattern property into account when generating mocks #1398

Merged
merged 1 commit into from
May 25, 2024

Conversation

AllieJonsson
Copy link
Contributor

Status

READY

Description

Fixes #1396. String properties has an optional field 'pattern', which contains a regex pattern: OpenAPI Spec
Faker has support for generating random strings based on a regex: faker.helpers.fromRegExp

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

yarn generate:swr
check tests/generated/swr/pattern/enpoints.ts -> getGetVversionExampleResponseMock

@melloware melloware added this to the 6.30.0 milestone May 25, 2024
@melloware melloware added the mock Related to mock generation label May 25, 2024
Copy link
Member

@soartec-lab soartec-lab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you nice update !

@soartec-lab soartec-lab merged commit e32d4ec into orval-labs:master May 25, 2024
2 checks passed
@soartec-lab soartec-lab added the enhancement New feature or request label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mock Related to mock generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]Enable faker.helpers.fromRegExp() to be applied to msw mock from pattern keyword
3 participants