xogroup / felicity

Javascript object constructors and sample data based on Joi schema.
Other
111 stars 9 forks source link

Apply parent presence flags when children do not have presence flags #122

Closed WesTyler closed 7 years ago

WesTyler commented 7 years ago

Description

When object children do not contain specific presence flags, the value provided to the parent .options({ presence: 'optional||required' }) should be respected for Felicity.example value generation.

Related Issue

Closes #121

Motivation and Context

This allows for bulk flag setting at the parent level instead of requiring the schema to specify .optional() on each and every child schema.

Types of changes

Checklist: