fix(oas31): fix recursive bug in hasUserEditedBody selector wrapper (#8499)
Refs #8498
This commit is contained in:
@@ -44,8 +44,10 @@ export const createOnlyOAS31SelectorWrapper =
|
||||
(oriSelector, system) =>
|
||||
(state, ...args) => {
|
||||
if (system.getSystem().specSelectors.isOAS31()) {
|
||||
const result = selector(state, ...args)
|
||||
return typeof result === "function" ? result(system) : result
|
||||
const selectedValue = selector(state, ...args)
|
||||
return typeof selectedValue === "function"
|
||||
? selectedValue(system)
|
||||
: selectedValue
|
||||
} else {
|
||||
return oriSelector(...args)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import { createOnlyOAS31SelectorWrapper } from "../fn"
|
||||
|
||||
export const hasUserEditedBody = createOnlyOAS31SelectorWrapper(
|
||||
@@ -8,7 +11,5 @@ export const hasUserEditedBody = createOnlyOAS31SelectorWrapper(
|
||||
// try it out functionality is disabled for webhooks
|
||||
return false
|
||||
}
|
||||
|
||||
return system.oas3Selectors.hasUserEditedBody([path, method])
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user