Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.modify(oai => Optional.fromNullableProp()("paths")
.composeIso(objectToArray())
.composeTraversal(fromTraversable(array)())
.composeLens(valueLens())
.modify(pathItem => prunePathItem(req.method, pathItem)) (
{
...oai,
...(oai.paths ? {
paths: Object.entries(oai.paths)
.reduce((i, [n, o]) =>
({
...i,
...(
matches(
truncatePath(req.pathname, oai, req),
n,
o,
const bodyFromResponse = (
schema: OpenAPIObject,
operation: Operation,
code: keyof Responses,
) =>
makeLensToResponseStartingFromOperation(schema, code)
.composeOptional(Optional.fromNullableProp()("content"))
.composeIso(objectToArray())
.composeOptional(firstElementOptional())
.composeLens(valueLens())
.composeOptional(Optional.fromNullableProp()("schema"))
.getOption(operation);