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