json-schema-faker: alwaysFakeOptionals doesn't always fake

If you are reporting a bug, please include the following:

When using 0.5.0-rc16 it seems that alwaysFakeOptionals does not seem to work as i’d expect. Understand this is not yet released, so perhaps this is a known issue.

With nested properties, these seem to only be occasionally generated, rather than always generated.

You can try this out here… https://runkit.com/nizmox/5bc0228ecd3ca800122bc854

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, sorry. It should be set on the schema itself.

Using jsf.option will not override anything, it’ll instead constraint schema settings to avoid excesive options like { "minItems": 100000 }. In that case, using jsf.option({ minItems: 10 }) will apply 10 instead, the same occurs with maxItems, minLength, minimum, etc.

If the schema were { "minItems": 3 } then 3 is used, because is not greater than the given on jsf.option({ minItems: 10 }), etc.