Skip to content

Commit

Permalink
fix: Empty instancePath with required property (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik committed Feb 29, 2024
2 parents 76496f1 + 20a07d7 commit b3288a2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ export class BaseReview {
let field: string;

return errors.reduce((obj, error) => {
[, field] = error.instancePath.split('/');
if (error.keyword === 'required') field = error.params.missingProperty;
else [, field] = error.instancePath.split('/');

field = field.replace(/~1/g, '/');
obj[field] = this.getMessage(error, field || error.schema[0], error.data, dateFormats);

Expand Down

0 comments on commit b3288a2

Please sign in to comment.