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(mocks): handle OpenAPI 3.1 nullability #1381

Merged
merged 1 commit into from
May 16, 2024

Conversation

arthurfiorette
Copy link
Contributor

@arthurfiorette arthurfiorette commented May 16, 2024

Status

READY

Description

Support for type: [X, null] into mocks. This PR is almost identical to the original one: https://github.com/anymaniax/orval/pull/645/files.

I reused the #645 spec to create this test.

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

It previously generated the following:

export const getFetchNullableResponseMock = (): FetchNullable200 => ({})

Now its working as intended

export const getFetchNullableResponseMock = (): FetchNullable200 =>
  faker.helpers.arrayElement([faker.word.sample(), null]);

@melloware melloware added the mock Related to mock generation label May 16, 2024
@melloware melloware merged commit efc4c35 into orval-labs:master May 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mock Related to mock generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants