def METHOD_NAME(self, codeowner: ProjectCodeOwners, project: Project) -> None:
    if not hasattr(codeowner, "schema") or (
        codeowner.schema
        and codeowner.schema.get("rules")
        and "id" not in codeowner.schema["rules"][0]["owners"][0].keys()
    ):
        # Convert raw to issue owners syntax so that the schema can be created
        raw = codeowner.raw
        associations, _ = validate_codeowners_associations(codeowner.raw, project)
        codeowner.raw = convert_codeowners_syntax(
            codeowner.raw,
            associations,
            codeowner.repository_project_path_config,
        )
        codeowner.schema = create_schema_from_issue_owners(
            codeowner.raw, project.id, add_owner_ids=True, remove_deleted_owners=True
        )
        # Convert raw back to codeowner type to be saved
        codeowner.raw = raw
        codeowner.save()