Using alwaysFakeOptionals with faker and JSON Schemas with circular references is a recipe for disaster. It can lead to JSON Schema Faker getting into an infinite loop when it requires an optional value to always be faked inside a circular referenced path.
Unfortunately, removing alwaysFakeOptionals means that the produced example JSON bodies with circular references are less deterministic because they can now randomly fake optional or not. Once we update to json-schema-faker 0.5.0-rc15 we can set optionalsProbability to zero so they will never be expanded which will be a more deterministic behaviour allowing us to restore the disable test in this PR.
Using
alwaysFakeOptionals
with faker and JSON Schemas with circular references is a recipe for disaster. It can lead to JSON Schema Faker getting into an infinite loop when it requires an optional value to always be faked inside a circular referenced path.Unfortunately, removing
alwaysFakeOptionals
means that the produced example JSON bodies with circular references are less deterministic because they can now randomly fake optional or not. Once we update to json-schema-faker 0.5.0-rc15 we can setoptionalsProbability
to zero so they will never be expanded which will be a more deterministic behaviour allowing us to restore the disable test in this PR.