import { getContentWithLegacyExamples, getValueFromMdParsedExtension, JsonPointer, } from '../utils/index.js';
import { getMediaContent } from './mediaContent.js';
export function getRequestBody({ parser, infoOrRef, options, isEvent, operation, }) {
    const { resolved: info } = parser.deref(infoOrRef);
    const description = getValueFromMdParsedExtension(info, 'description') || '';
    const required = info.required;
    let content;
    const isRequestType = !isEvent;
    const mediaContent = getContentWithLegacyExamples(info);
    if (mediaContent !== undefined) {
        content = getMediaContent({
            parser,
            info: mediaContent,
            isRequestType,
            options,
            data: {
                operation,
                type: 'request',
                absolutePointer: infoOrRef['$ref'] || JsonPointer.join(operation.pointer, ['requestBody']),
            },
        });
    }
    return { description, required, content };
}
//# sourceMappingURL=request.js.map