From f866d9194c386b3a9fa0d00f83db5b48d89e9f26 Mon Sep 17 00:00:00 2001 From: amortenson Date: Thu, 30 Mar 2023 13:48:51 -0600 Subject: [PATCH] fix: Using the lodash set function was causing an error when the path ended in a number. This is because the previous specified object in the path was set as an array. Using the lodash setWith function allows specifying everything to be set as an object. --- src/vfjs-global-mixin/methods/vfjs-validation/getters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vfjs-global-mixin/methods/vfjs-validation/getters.js b/src/vfjs-global-mixin/methods/vfjs-validation/getters.js index fb821dbc..734f30e0 100644 --- a/src/vfjs-global-mixin/methods/vfjs-validation/getters.js +++ b/src/vfjs-global-mixin/methods/vfjs-validation/getters.js @@ -1,4 +1,4 @@ -import { set } from 'lodash'; +import { set, setWith } from 'lodash'; const vfjsValidationGetters = { /** getVfjsPropertiesRequired @@ -122,7 +122,7 @@ const vfjsValidationGetters = { const required = previousPaths.length > 0 ? `${previousProperties}.required` : 'required'; if (index === paths.length - 1) { - set(schema, properties, fieldSchema); + setWith(schema, properties, fieldSchema, Object); if (isRequired) { set(schema, required, [path]);