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

Factory doesn't generate empty entities #844

Open
ekarademir opened this issue Apr 26, 2024 · 1 comment
Open

Factory doesn't generate empty entities #844

ekarademir opened this issue Apr 26, 2024 · 1 comment
Labels

Comments

@ekarademir
Copy link
Contributor

Factory class advertises an option to generate empty entity instead of a "sample", however the option has no effect

Bug Report 🐛

As it's being used by the CLI generate command here, and being passed onto the factory class here, there should be an option to generate empty objects as advertised here.

But that option is simply being ignored.

Expected Behavior

That the factory returns an entity with empty values

Current Behavior

Returns sampled data as values

Possible Solution

Steps to Reproduce

  1. Use the setup outlined in the CLI command.
  2. Inspect the JSON document

Context (Environment)

Desktop

  • OS: macOS
  • Browser: Chrome & Node

Detailed Description

Possible Implementation

@mttrbrts mttrbrts added Type: Bug 🐛 Something isn't working Difficulty: Starter labels May 1, 2024
@mttrbrts
Copy link
Member

mttrbrts commented May 1, 2024

@ekarademir do the String properties in your model have min/max length validators?

We made the decision when adding those that the output of the value generators should always be a valid instance. This forces us to generate some sample data even when using the empty mode.

I think that there's scope to improve the logic here, for example:

  • Generate only using spaces, when in empty mode
  • Always use the min length when specified in empty mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants