import{normalizeOptions as s}from"@redocly/openapi-docs";import{getOperation as l}from"../../../../markdoc/helpers/get-operation/index.js";import{setNodeAttributeValue as f}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{getMediaContentSamples as c}from"./helpers/get-media-content-samples.js";import{loadOpenapiBundle as u}from"./helpers/load-openapi-bundle.js";import{getOptionalAttribute as o}from"./utils.js";async function h(t,a,O,{context:m}){const e=await u(t,m);if(!e)return;const i=o(t,"exampleKey"),n=l({definition:e.definition,options:e.rawOptions},{operationId:o(t,"operationId"),pointer:o(t,"pointer")},s(e.rawOptions),{exampleKey:i});if(!n)return;const r=(n.responses??[]).flatMap(p=>c(p.content,i,`${p.code}`));r.length&&f(t,a,r)}export{h as resolveOpenapiResponseSamples};
