From 8e25598f22018595487f9a857b39f19df31cd86a Mon Sep 17 00:00:00 2001 From: Oliwia Rogala Date: Tue, 20 May 2025 13:24:25 +0200 Subject: [PATCH] fix(spec): avoid accessing $ref when path item is not an object --- src/core/plugins/spec/wrap-actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/plugins/spec/wrap-actions.js b/src/core/plugins/spec/wrap-actions.js index 506e5e9fd6d..b8af37c7712 100644 --- a/src/core/plugins/spec/wrap-actions.js +++ b/src/core/plugins/spec/wrap-actions.js @@ -1,4 +1,5 @@ import get from "lodash/get" +import isPlainObject from "lodash/isPlainObject" export const updateSpec = (ori, {specActions}) => (...args) => { ori(...args) @@ -18,7 +19,7 @@ export const updateJsonSpec = (ori, {specActions}) => (...args) => { pathItemKeys.forEach(k => { const val = get(pathItems, [k]) - if(val.$ref) { + if (isPlainObject(val) && val.$ref) { specActions.requestResolvedSubtree(["paths", k]) } })