Don't change validationSchema based on input #15108
Labels
area/frontend
Related to the Airbyte webapp
team/extensibility
technical-debt
issues to fix code smell
Currently our code does change the
validationSchema
of the ServiceForm based on some values, e.g. if the user selects another oneOf value with a sub object the whole validationSchema will change to reflect that.I think we should try to generate the
validationSchema
once for the connectors spec and not change it based on the form values. Yup supportswhen
to actually annotate that specific parts of a schema are only in effect when specific criterias are met. I think we should rather use that functionality to generate one validationSchema, that useswhen
to validate the different choices of aoneOf
JSONSchema.Especially since Formik doesn't revalidate the form when the validationSchema changes, we need to have special hacks for that in place.
This would require #13056 to be solved, so that the formik form actually only contain the individual connectors form, and thus the validationSchema could be kept unchanged while filling the form.
The text was updated successfully, but these errors were encountered: