Skip to content

fix(mock): falsy examples were ignored #2110

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

Merged
merged 4 commits into from
May 23, 2025

Conversation

javiergarmon
Copy link
Contributor

@javiergarmon javiergarmon commented May 23, 2025

Status

READY

Description

Properties with falsy examples (like a boolean with false or a nullable prop with null) didn't generate the mock with those examples and put a faker boolean call instead. This PR take into account those values.

Related PRs

None

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

Test were added. Anyway, just a property like this reproduces the error:

"isEnabled": {
  "type": "boolean",
  "example": false
},

@melloware melloware merged commit 6914ccc into orval-labs:master May 23, 2025
2 checks passed
@soartec-lab soartec-lab added mock Related to mock generation msw MSW related issues labels Jun 7, 2025
@soartec-lab soartec-lab added this to the 7.10.0 milestone Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mock Related to mock generation msw MSW related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants