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
I am trying to validate a Record<number, Settings> where the keys are dynamically retrieved from an API.
I have this schema:
const formSchema = object({ venueSettings: lazy((value: Record<number, Settings>) => { let schema = object(); for (const venue of venues.value) { var s = value?.[venue.id]; if (s != null && (s.userId || s.spaceId || s.apiSecret)) { schema = schema.shape({ [venue.id]: object().label(venue.id).shape({ userId: string().required("Veuillez entrer votre identifiant d'utilisateur"), spaceId: string().required("Veuillez entrer votre identifiant de Space"), apiSecret: string().required("Veuillez entrer votre clé d'API") }) }) } } console.log("Schema: " + JSON.stringify(schema, null, 2)); return schema; }) });
which does catch errors, however the path stops at venueSettings: Form errors: {"venueSettings":"Veuillez entrer votre identifiant d'utilisateur"}
Form errors: {"venueSettings":"Veuillez entrer votre identifiant d'utilisateur"}
How can I get the error reported under venueSettings.4.userId ?
venueSettings.4.userId
I created what I believe is a reproducible example, though I can't figure out how to actually run the test in codesandbox :(
Codesandbox test case
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to validate a Record<number, Settings> where the keys are dynamically retrieved from an API.
I have this schema:
which does catch errors, however the path stops at venueSettings:
Form errors: {"venueSettings":"Veuillez entrer votre identifiant d'utilisateur"}
How can I get the error reported under
venueSettings.4.userId
?I created what I believe is a reproducible example, though I can't figure out how to actually run the test in codesandbox :(
Codesandbox test case
The text was updated successfully, but these errors were encountered: