Making all properties required in a `Schema.Struct` and ensuring that samples generated from it h...

Hi,
I have a Schema Struct with optional properties that have arbitrary annotations. Now I would like to create a Schema Struct where all properties would be required, so the arbitrary sample would not be undefined.
I tried to apply const RequiredStruct = Schema.required(originalStruct) to the original Schema and call Arbitrary.make(RequiredStruct) but the sample produced from this still has all keys optional and randomly some properties are undefined.
Is this because the annotations are called on the Schema in the time when its optional and that creates a closure ?
Is there a way you would suggest, how to make the sample act like all properties are required, using some utility and preserving the original Schema Struct as is, with optional properties ?

And a second question, is there a way to apply deeply nested Schema.required ? It seems to transform only one level deep.

Thank you !
Was this page helpful?