fix(oas31): detect user request body edits in OpenAPI.paths (#8500)
Affected wrapped selector was hasUserEditedBody. This commit fixes the bug by calling the original selector when path+method combination is not found in OpenAPI.webhooks field. Refs #8498
This commit is contained in:
@@ -46,7 +46,7 @@ export const createOnlyOAS31SelectorWrapper =
|
|||||||
if (system.getSystem().specSelectors.isOAS31()) {
|
if (system.getSystem().specSelectors.isOAS31()) {
|
||||||
const selectedValue = selector(state, ...args)
|
const selectedValue = selector(state, ...args)
|
||||||
return typeof selectedValue === "function"
|
return typeof selectedValue === "function"
|
||||||
? selectedValue(system)
|
? selectedValue(oriSelector, system)
|
||||||
: selectedValue
|
: selectedValue
|
||||||
} else {
|
} else {
|
||||||
return oriSelector(...args)
|
return oriSelector(...args)
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
import { createOnlyOAS31SelectorWrapper } from "../fn"
|
import { createOnlyOAS31SelectorWrapper } from "../fn"
|
||||||
|
|
||||||
export const hasUserEditedBody = createOnlyOAS31SelectorWrapper(
|
export const hasUserEditedBody = createOnlyOAS31SelectorWrapper(
|
||||||
(state, path, method) => (system) => {
|
(state, path, method) => (oriSelector, system) => {
|
||||||
const webhooks = system.specSelectors.webhooks()
|
const webhooks = system.specSelectors.webhooks()
|
||||||
|
|
||||||
if (webhooks.hasIn([path, method])) {
|
if (webhooks.hasIn([path, method])) {
|
||||||
// try it out functionality is disabled for webhooks
|
// try it out functionality is disabled for webhooks
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return oriSelector(path, method)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const isOAS3 =
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const selectLicenseUrl = createOnlyOAS31SelectorWrapper(
|
export const selectLicenseUrl = createOnlyOAS31SelectorWrapper(
|
||||||
() => (system) => {
|
() => (oriSelector, system) => {
|
||||||
return system.oas31Selectors.selectLicenseUrl()
|
return system.oas31Selectors.selectLicenseUrl()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user