fix(callbacks): display all defined callbacks (#9223)

Refs #9222
This commit is contained in:
Vladimír Gorej
2023-09-18 09:26:12 +02:00
committed by GitHub
parent 23f6645ad8
commit 0144dad03d
3 changed files with 79 additions and 14 deletions

View File

@@ -58,22 +58,27 @@ export const callbacksOperations = onlyOAS3(
.reduce((allOperations, callback, callbackName) => {
if (!Map.isMap(callback)) return allOperations
return callback.reduce((callbackOperations, pathItem, expression) => {
if (!Map.isMap(pathItem)) return callbackOperations
const callbackOperations = callback.reduce(
(callbackOps, pathItem, expression) => {
if (!Map.isMap(pathItem)) return callbackOps
const pathItemOperations = pathItem
.entrySeq()
.filter(([key]) => validOperationMethods.includes(key))
.map(([method, operation]) => ({
operation: Map({ operation }),
method,
path: expression,
callbackName,
specPath: specPath.concat([callbackName, expression, method]),
}))
const pathItemOperations = pathItem
.entrySeq()
.filter(([key]) => validOperationMethods.includes(key))
.map(([method, operation]) => ({
operation: Map({ operation }),
method,
path: expression,
callbackName,
specPath: specPath.concat([callbackName, expression, method]),
}))
return callbackOperations.concat(pathItemOperations)
}, List())
return callbackOps.concat(pathItemOperations)
},
List()
)
return allOperations.concat(callbackOperations)
}, List())
.groupBy((operationDTO) => operationDTO.callbackName)
.map((operations) => operations.toArray())