We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
Hi I am getting a cyclic dependency error when using pick()in combination with shape() in yup 1.2.0. The problem seems similar to #1969
To Reproduce
import { object, string } from 'yup'; const testObject = { a1: undefined, a2: 'over9000', }; const a1 = string().when('a2', { is: undefined, then: (schema) => schema.required(), }); const a2 = string().when('a1', { is: undefined, then: (schema) => schema.required(), }); const schema = object({ a3: string().required(), a4: string().required() }).shape({ a1, a2 }, [ ['a1', 'a2'], ]); const isValid = schema.pick(['a1', 'a2']).isValid(testObject);
Here is a very basic demo showing the resulting error: https://plnkr.co/edit/Nbdwma2bEbtSrxje
The resulting error is: Error: Cyclic dependency, node was:"a2"
Error: Cyclic dependency, node was:"a2"
Expected behavior The schema is able to validate properly for the picked fields.
Platform (please complete the following information):
The text was updated successfully, but these errors were encountered:
@jquense is there a known way to work around this problem?
Sorry, something went wrong.
6956ee7
No branches or pull requests
Describe the bug
Hi I am getting a cyclic dependency error when using pick()in combination with shape() in yup 1.2.0. The problem seems similar to #1969
To Reproduce
Here is a very basic demo showing the resulting error: https://plnkr.co/edit/Nbdwma2bEbtSrxje
The resulting error is:
Error: Cyclic dependency, node was:"a2"
Expected behavior
The schema is able to validate properly for the picked fields.
Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: