Skip to content

Commit 581d544

Browse files
authored
fix(spec): avoid accessing $ref when path item is not an object (#10456)
1 parent 8577d71 commit 581d544

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/plugins/spec/wrap-actions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import get from "lodash/get"
2+
import isPlainObject from "lodash/isPlainObject"
23

34
export const updateSpec = (ori, {specActions}) => (...args) => {
45
ori(...args)
@@ -18,7 +19,7 @@ export const updateJsonSpec = (ori, {specActions}) => (...args) => {
1819
pathItemKeys.forEach(k => {
1920
const val = get(pathItems, [k])
2021

21-
if(val.$ref) {
22+
if (isPlainObject(val) && val.$ref) {
2223
specActions.requestResolvedSubtree(["paths", k])
2324
}
2425
})

0 commit comments

Comments
 (0)