rsuite / schema-typed

Schema for data modeling & validation
MIT License
198 stars 28 forks source link

schemaSpec is undefined for .when() inside ObjectType #73

Open femi-lynx-fh opened 1 year ago

femi-lynx-fh commented 1 year ago

What version of schema-typed are you using?

2.1.3

Describe the Bug

If using the "when" method within an ObjectType, the schemaSpec variable that is passed to the method is undefined.

Expected Behavior

schemaSpec that is passed to the when method should be populated with the schema of the model.

To Reproduce

Working example without ObjectType: https://stackblitz.com/edit/typescript-jkedsj?file=index.ts Bug example: https://stackblitz.com/edit/typescript-yv9jop?file=index.ts