refactor(oas31): disable try it out mechanism explicitly for webhooks (#8485)
Refs #8474
This commit is contained in:
@@ -11,7 +11,7 @@ export const isOAS31 = (jsSpec) => {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates selector that returns value of the original
|
||||
* Creates selector that returns value of the passed
|
||||
* selector when spec is OpenAPI 3.1.0., null otherwise.
|
||||
*
|
||||
* @param selector
|
||||
@@ -31,6 +31,26 @@ export const createOnlyOAS31Selector =
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates selector wrapper that returns value of the passed
|
||||
* selector when spec is OpenAPI 3.1.0., calls original selector otherwise.
|
||||
*
|
||||
*
|
||||
* @param selector
|
||||
* @returns {function(*, *): function(*, ...[*]): (*)}
|
||||
*/
|
||||
export const createOnlyOAS31SelectorWrapper =
|
||||
(selector) =>
|
||||
(oriSelector, system) =>
|
||||
(state, ...args) => {
|
||||
if (system.getSystem().specSelectors.isOAS31()) {
|
||||
const result = selector(state, ...args)
|
||||
return typeof result === "function" ? result(system) : result
|
||||
} else {
|
||||
return oriSelector(...args)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates selector that provides system as the
|
||||
* second argument. This allows to create memoized
|
||||
|
||||
Reference in New Issue
Block a user