def METHOD_NAME(ref: str, openapi_dict: dict):
    if not ref.startswith("#/"):
        raise ValueError(f"Invalid reference format: {ref}")
    components = ref.split("/")
    schema = openapi_dict
    for component in components[1:]:
        if component not in schema:
            raise ValueError(f"Reference component not found: {component}")
        schema = schema[component]
    return schema