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): ref in allOf expands the object #1638

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

soartec-lab
Copy link
Member

Status

READY/WIP/HOLD

Description

fix #1119

Fixed a syntax error that occurred when using ref in an item referenced by allOf.
The reference with ref is not necessarily an object, but there are few cases where allOf refers to an item other than an object, so this covers many cases.

Before

ref objects will cause an syntax error.

export const getGetNestedRefInAllOfPetsResponseMock = (): GetNestedRefInAllOfPets200 => ({{id: faker.number.int({min: undefined, max: undefined}), name: faker.word.sample()},tag: faker.word.sample()})

After

ref objects are expanded so no error occurs.

export const getGetNestedRefInAllOfPetsResponseMock = (): GetNestedRefInAllOfPets200 => ({...{id: faker.number.int({min: undefined, max: undefined}), name: faker.word.sample()},tag: faker.word.sample()})

Related PRs

none

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

i added test case

@soartec-lab soartec-lab added bug Something isn't working msw MSW related issues labels Sep 23, 2024
@soartec-lab soartec-lab added this to the 7.2.0 milestone Sep 23, 2024
@melloware melloware merged commit a45b20f into orval-labs:master Sep 23, 2024
2 checks passed
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.

Syntax error in mock function when allOf and nested schema references are used together
2 participants