Open jakelowen opened 5 years ago
Amazing library. I've been playing with this concept for a while and your execution is very clean.
This may be very "meta" request, but do you have a ready example of a proper yup.schema of a yup-ast definition itself?
My use case: I'm attempting to validate an object of which a yup-ast definition is one aspect among others.
Example: see the "triggerConditions" line below.
let schema = yup.object().shape({ name: yup.string(), id: yup.string(), notes: yup.string(), steps: yup .array() .of( yup.object().shape({ name: yup.string().required(), topic: yup.string().required(), // triggerConditions is a yup-ast definition triggerConditions: yup.array().of(yup.array()), extractions: yup.array().of( yup.array().of(yup.string()).min(1) ).required(), required: yup.boolean().required(), maxAttempts: yup.number().min(1).positive().required() }) ) .required() });
Should I be more specific than yup.array().of(yup.array()) ?
yup.array().of(yup.array())
Sounds like you need to write a custom validator for yup, to validate the yup-ast format
yup
yup-ast
Unfortunately I can't make any changes due to https://github.com/WASD-Team/yup-ast/issues/10
Amazing library. I've been playing with this concept for a while and your execution is very clean.
This may be very "meta" request, but do you have a ready example of a proper yup.schema of a yup-ast definition itself?
My use case: I'm attempting to validate an object of which a yup-ast definition is one aspect among others.
Example: see the "triggerConditions" line below.
Should I be more specific than
yup.array().of(yup.array())
?