Skip to content

client.pages.projects.list returns a paginated list of Deployments instead of Projects #2692

@iBug

Description

@iBug

Confirm this is a Python library issue and not an underlying Cloudflare API issue.

  • This is an issue with the Python library

Describe the bug

As the title says, client.pages.projects.list returns a paginated list of Deployments instead of Projects.

To Reproduce

Assertions should pass, but they fail.

import cloudflare
from pydantic import BaseModel

class Config(BaseModel):
    account_id: str
    api_token: str

with open("config.json", "r") as f:
    config = Config.model_validate_json(f.read())

client = cloudflare.Cloudflare(api_token=config.api_token)
for project in client.pages.projects.list(account_id=config.account_id):
    assert not isinstance(project, cloudflare.types.pages.deployment.Deployment)
    assert isinstance(project, cloudflare.types.pages.project.Project)
    break

Code snippets

OS

Ubuntu 24.04

Python version

3.12.3

Library version

4.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions