fix(csharp,unity,php,ruby): keep paginating on the result length when numPages is missing or null

Draft
AS
9h ago
+353-2

Summary

When an offsetLimit pagination operation declares both a numPages and a results output, the C#, Unity, PHP and Ruby SDKs ended pagination as soon as a response omitted numPages or sent it as null: C# and Unity returned null from Next(), Ruby raised NoMethodError comparing nil <= page, and PHP compared a missing path result against the page. They now stop only when numPages is numeric and <= page; otherwise they fall through to the results-length check (an empty or short page ends pagination), matching the Go, TypeScript and Python behaviour (fixed separately).

Java needed no template change: with a results output the generated paginator already uses ResultsPageTracker, which advances on the page length. This PR adds the runtime test for Java and removes its skip; the top-level Java lambda template is not rendered by the generator and is left untouched.

Behaviour change

A server that omits numPages and clamps out-of-range page numbers (keeps returning a full last page) previously stopped silently after the first page in these SDKs; it will now keep requesting pages. Such a server must return an empty or short page past the end, or state numPages.

Tests

  • New shared fragment tests/specs/fragments/uber/pagination-num-pages-missing.yaml (paginationLimitOffsetPageNumPagesMissing) and api-test-service handler /pagination/limitoffset/page/num_pages_missing: page 1 omits numPages, page 2 sends null, page 3 sends 3; limit 7, 20 items.
  • A runtime test in each target's existing primary pagination test file asserts omitted vs explicit-null numPages where the model distinguishes them (C# OptionalNullable, Java JsonNullable), the exact result arrays [0..6], [7..13], [14..19], and that no fourth page is fetched.
  • Locally, C# and Ruby fail without the template change (C#: Next() returns null after page 1; Ruby: undefined method '<=' for nil) and pass with it; Java passes. PHP relies on CI; Unity has no test runner.
  • Go, TypeScript, Python, CLI and MCP keep pagination-limit-offset-page-num-pages-missing in their skip lists until their own fix lands.

Summary by cubic

Fixes premature pagination termination in the C#, Unity, PHP, and Ruby SDKs when an offsetLimit operation declares both numPages and results outputs.

Previously, a response that omitted numPages or sent it as null ended pagination after the first page. These SDKs now only stop when numPages is numeric and <= page; otherwise, they fall back to the results-length check, matching Go, TypeScript, and Python. Java already paginated correctly through ResultsPageTracker, so it only gains the runtime test.

Behavior change

  • A server that omits numPages and keeps returning a full last page will now keep getting requested until it returns an empty or short page or states numPages.

Tests

  • Adds a shared test fragment and test-service handler serving three pages: page 1 omits numPages, page 2 sends null, page 3 sends 3.
  • Adds runtime tests to each target's existing pagination test file.
  • Go, TypeScript, Python, CLI, and MCP keep the new test in their skip lists until their own fixes land.