Skip to content

Undocumented breaking change for 3.0.0: serverRelativeUrl properties changed to server_relative_url #1037

Closed

Description

@emredjan

In all places, sharepoint file and folder property .serverRelativeUrl is changed to .server_relative_url, breaking many existing flows (that work fine in 2.6.2) with errors similar to: AttributeError: 'File' object has no attribute 'serverRelativeUrl' in version 3.0.0

This is not listed as a breaking change in the release notes, nor there was any deprecation notice in prior versions.

Also, the change is (probably) not reflected in type stubs and the linters fail to recognize the new .server_relative_url property.

Tested in:

Python 3.14.7
office365-rest-python-client 3.0.0

Activity

  1. added
    installationpip install failures, dependency conflicts, environment issues
    on Sep 3, 2026
  2. office365-maintainer commented on Oct 18, 2026

    @office365-maintainer

    You are right on both counts that matter: 3.0.0 did rename these properties, and it was never listed as a breaking change. That gap is now fixed in the repo (6973b3a13):

    The mapping is mechanical: take the OData key, lowercase the first letter, _ before each capital. 628 properties moved this way.

    2.x 3.x
    file.serverRelativeUrl file.server_relative_url
    file.timeCreated file.time_created
    folder.listItemAllFields folder.list_item_all_fields
    list.contentTypes list.content_types
    web.allProperties web.all_properties

    Only the Python attribute moved — the wire keys did not, so these still work:

    file.properties["ServerRelativeUrl"]        # raw payload value
    file.get_property("ServerRelativeUrl")      # returns file.server_relative_url
    file.ensure_property("ServerRelativeUrl")   # request the wire name explicitly
    list_obj.items.select(["Id", "ServerRelativeUrl"])   # $select/$expand take wire names

    On the type-stub point: I checked that too, and the new name does type-check. The property is an ordinary typed @property, not an __getattr__ fallback — pyright reports 0 errors on file.server_relative_url and correctly errors on file.serverRelativeUrl:

    error: Cannot access attribute "serverRelativeUrl" for class "File"
      Attribute "serverRelativeUrl" is unknown (reportAttributeAccessIssue)
    

    So the linter message you saw is accurate rather than a stub gap — which makes it the fastest way to migrate: run pyright/mypy over your code, and each stale access is reported with its class. The new page documents that trick.

    No camelCase aliases shipped in 3.x (the old names raise AttributeError by design), so if a codebase can't be migrated yet, pin office365-rest-python-client==2.6.2. Thanks for pushing on the documentation side of this — the omission was real.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    installationpip install failures, dependency conflicts, environment issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions