Skip to content

[F] getResultModelWithProperty

function getResultModelWithProperty(
program,
operation,
predicate): undefined | [Model, ModelProperty]

Return the first response model that has any properties matching the given model property predicate

Parameters

ParameterTypeDescription
programProgramThe program being processed
operationOperationThe operation to retrieve matching response from
predicate(prop) => booleanThe predicate function to apply to each model property of the responses

Returns

undefined | [Model, ModelProperty]

The model and matching model property, or nothing if no matching models are found