fix: default to empty object for pathItems in updateJsonSpec wrap-action (#4785)

cc #4784
This commit is contained in:
kyle
2018-08-02 20:34:51 -07:00
committed by GitHub
parent 5431eed1cd
commit fe5b2344c7

View File

@@ -12,7 +12,7 @@ export const updateJsonSpec = (ori, {specActions}) => (...args) => {
// Trigger resolution of any path-level $refs. // Trigger resolution of any path-level $refs.
const [json] = args const [json] = args
const pathItems = get(json, ["paths"]) const pathItems = get(json, ["paths"]) || {}
const pathItemKeys = Object.keys(pathItems) const pathItemKeys = Object.keys(pathItems)
pathItemKeys.forEach(k => { pathItemKeys.forEach(k => {