Skip to content

Add backward-compatible pagination metadata #61

Description

@omandryk

Problem

WooCommerce list responses expose pagination metadata through X-WP-Total and X-WP-TotalPages, but the current client returns only a raw List. PR #39 by @nouhouari demonstrated the desired metadata, but its implementation changes the return type of existing getAll(...) methods and therefore breaks the public 1.x API. It also combines pagination with an unrelated Maven signing-plugin change.

Acceptance criteria

  • Preserve all existing getAll(...) method signatures and behavior in the 1.x line.
  • Add pagination through a new backward-compatible method or result type rather than replacing the existing List return type.
  • Safely handle either pagination header being absent, malformed, or supplied independently; do not assume both exist.
  • Parse headers case-insensitively and avoid unchecked null access.
  • Add focused tests for content, totals, page counts, empty results, and missing/malformed headers using a controlled HTTP response.
  • Keep release/signing plugin changes outside the pagination implementation.
  • Validate behavior against a disposable WooCommerce installation before release.
  • Credit @nouhouari and PR Manage pagination #39 in the eventual implementation/release notes.

Possible v2 direction

A typed page result may become the primary API in 2.x, but the 1.x implementation must remain source- and binary-compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions