def METHOD_NAME(filepath: Path, specs: dict):
    from os.path import abspath, exists, isabs, relpath
    filedir = filepath.parent
    for key, value in specs.items():
        if isinstance(value, dict):
            # navigate specs
            METHOD_NAME(filepath, value)
        elif key in ("allOf", "oneOf", "anyOf"):  # navigates allOf, oneOf, anyOf
            for item in value:
                METHOD_NAME(filepath, item)
        elif key == "$ref":
            # Ensures value = "file_ref#section_ref"
            value = str(value)
            if value.startswith("#"):
                value = str(filepath) + value
            elif "#" not in value:
                value = value + "# "
            file_ref, section_ref = value.split("#")
            if not isabs(file_ref):
                file_ref = str(filedir / file_ref)
            file_ref = abspath(file_ref)  # resolves
            assert exists(file_ref), file_ref
            if (
                "schemas" in file_ref
            ):  # reference to a schema file (i.e. inside a schemas folder)
                if not section_ref.startswith("/components/schemas/"):  # not updated!
                    section_ref = (
                        "/components/schemas/" + section_ref.lstrip("/").strip()
                    )
                    if file_ref.endswith(
                        CONVERTED_SUFFIX
                    ):  # fake name used in converted schemas
                        section_ref += _FAKE_SCHEMA_NAME
                    file_ref = (
                        "./" + relpath(file_ref, filedir)
                        if not filepath.samefile(file_ref)
                        else ""
                    )
                    specs[key] = file_ref + "#" + section_ref