import { isReferenceObject } from "../../3.1/guards/isReferenceObject";
import { resolveReference } from "./resolveReference";
export function resolveWebhookReference(operationItem, document) {
    if (isReferenceObject(operationItem)) {
        const resolved = resolveReference(operationItem, document, undefined);
        if (resolved == null) {
            return undefined;
        }
        return {
            ...resolved,
            ...operationItem,
        };
    }
    return operationItem;
}
