`client.pages.projects.list` returns a paginated list of `Deployment`s instead of `Project`s

Open Beginner friendly
#2,692 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start at client.pages.projects.list and inspect how its paginated results are typed and mapped to cloudflare.types.pages.deployment.Deployment versus cloudflare.types.pages.project.Project. Run the provided Python reproduction against the listed library version and confirm that each result is a Project and not a Deployment.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
509
Forks
150
Avg merge
3h 15m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflare-python

All issues in cloudflare/cloudflare-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.