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
- Avoid negative values for array.length; fix #477 — committed to json-schema-faker/json-schema-faker by pateketrueke 6 years ago
- Fix #52103 : Requires metadata in schema otherwise never generated We added required as a way to force json-schema-faker to generate metadata (https://github.com/json-schema-faker/json-schema-faker/i... — committed to faberNovel/pericles by Hugo-Hache 5 years ago
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, usingjsf.option({ minItems: 10 })
will apply10
instead, the same occurs withmaxItems
,minLength
,minimum
, etc.If the schema were
{ "minItems": 3 }
then3
is used, because is not greater than the given onjsf.option({ minItems: 10 })
, etc.