Skip to content

Commit 0fd3560

Browse files
steven-aertsshockey
authored andcommitted
fix: resolve referenced securitySchemes (via #5028)
1 parent 354c30c commit 0fd3560

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/core/plugins/oas3/spec-extensions/wrap-selectors.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createSelector } from "reselect"
2+
import { specJsonWithResolvedSubtrees } from "../../spec/selectors"
23
import { Map } from "immutable"
34
import { isOAS3 as isOAS3Helper, isSwagger2 as isSwagger2Helper } from "../helpers"
45

@@ -53,7 +54,7 @@ export const hasHost = onlyOAS3((state) => {
5354
})
5455

5556
export const securityDefinitions = onlyOAS3(createSelector(
56-
spec,
57+
specJsonWithResolvedSubtrees,
5758
spec => spec.getIn(["components", "securitySchemes"]) || null
5859
))
5960

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export const updateJsonSpec = (ori, {specActions}) => (...args) => {
2222
specActions.requestResolvedSubtree(["paths", k])
2323
}
2424
})
25+
26+
// Trigger resolution of any securitySchemes-level $refs.
27+
specActions.requestResolvedSubtree(["components", "securitySchemes"])
2528
}
2629

2730
// Log the request ( just for debugging, shouldn't affect prod )

0 commit comments

Comments
 (0)