fix: resolve referenced securitySchemes (via #5028)

This commit is contained in:
Steven Aerts
2018-11-16 00:21:01 +01:00
committed by kyle
parent 354c30c659
commit 0fd35603e6
2 changed files with 5 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { createSelector } from "reselect"
import { specJsonWithResolvedSubtrees } from "../../spec/selectors"
import { Map } from "immutable"
import { isOAS3 as isOAS3Helper, isSwagger2 as isSwagger2Helper } from "../helpers"
@@ -53,7 +54,7 @@ export const hasHost = onlyOAS3((state) => {
})
export const securityDefinitions = onlyOAS3(createSelector(
spec,
specJsonWithResolvedSubtrees,
spec => spec.getIn(["components", "securitySchemes"]) || null
))

View File

@@ -22,6 +22,9 @@ export const updateJsonSpec = (ori, {specActions}) => (...args) => {
specActions.requestResolvedSubtree(["paths", k])
}
})
// Trigger resolution of any securitySchemes-level $refs.
specActions.requestResolvedSubtree(["components", "securitySchemes"])
}
// Log the request ( just for debugging, shouldn't affect prod )