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

fix(msw): fix break msw when anyof included allof #1635

Conversation

soartec-lab
Copy link
Member

Status

READY

Description

fix #1508
Previously, an allOf object was maked only if oneOf contained allOf, and msw would break when anyOf contained allOf. Therefore, i have fixed it so that anyOf now generates an Allof object just like oneOf.

Before

type: faker.word.sample(),name: faker.word.sample() is not object so syntax error.

export const getGetAnyOfIncludedAllOfPetsResponseMock = (): Pet => (faker.helpers.arrayElement([{color: faker.word.sample()},type: faker.word.sample(),name: faker.word.sample()]))

After

{type: faker.word.sample(),name: faker.word.sample()} is object so there is no syntax error.

export const getGetAnyOfIncludedAllOfPetsResponseMock = (): Pet => (faker.helpers.arrayElement([{color: faker.word.sample()},{type: faker.word.sample(),name: faker.word.sample()}]))

Related PRs

List related PRs against other branches:

branch PR
other_pr_production link
other_pr_master link

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

you can check by i added test case

@soartec-lab soartec-lab added bug Something isn't working msw MSW related issues labels Sep 22, 2024
@soartec-lab soartec-lab added this to the 7.2.0 milestone Sep 22, 2024
@melloware melloware merged commit f373039 into orval-labs:master Sep 22, 2024
2 checks passed
@soartec-lab soartec-lab mentioned this pull request Dec 27, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working msw MSW related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSW: anyOf items using allOf msw mock generation bug
2 participants