import{OPENAPI_SHARED_DATA_PREFIX as n}from"../../../../constants/plugins/openapi-docs.js";import{getNodeAttribute as a}from"../../../../../markdoc/helpers/get-node-attribute.js";import{logger as d}from"../../../../tools/notifiers/logger.js";async function l(r,i){const e=a(r,"descriptionFile");if(typeof e!="string"||!e.startsWith(n))return;const o=e.slice(n.length);try{const{data:t}=await i.cache.load(o,"load-oas");return t?.[0]}catch(t){d.verbose(`Failed to load OpenAPI definition ${o} for the ${r.tag} tag: ${t instanceof Error?t.message:"Unknown error"}`);return}}export{l as loadOpenapiBundle};
