async function conditionalSubjectGeneration (
  asyncapiDocument,
  templateConfig,
  matchedConditionPath,
  templateParams

) {
  const fileCondition = templateConfig.conditionalGeneration?.[matchedConditionPath] || templateConfig.conditionalFiles?.[matchedConditionPath];
  if (!fileCondition || !fileCondition.subject) {
    return true; 
  }
  const { subject } = fileCondition;
  const server = templateParams.server && asyncapiDocument.servers().get(templateParams.server);
  const source = jmespath.search({
    ...asyncapiDocument.json(),
    ...{
      server: server ? server.json() : undefined,
    },
  }, subject);

  if (!source) {
    log.debug(logMessage.relativeSourceFileNotGenerated(matchedConditionPath, subject));
    return false;
  } 
  return validateStatus(source, matchedConditionPath, templateConfig);
}
Determines whether a file should be conditionally included based on the provided subject expression
and optional validation logic defined in the template configuration.
@private
@param {Object} asyncapiDocument - The parsed AsyncAPI document instance used for context evaluation.
@param {Object} templateConfig - The configuration object that contains `conditionalFiles` rules.
@param {String} matchedConditionPath - The relative path to the directory of the source file.
@param {Object} templateParams - Parameters passed to the template.
@returns {Boolean} - Returns `true` if the file should be included; `false` if it should be skipped.