Repository navigation
Description
Summary
Every count in Core is integer (e.g. OppFunding.minAwardCount) except in lib/core/lib/core/pagination.tsp; the only other int32 in the library is the HTTP status code on the response models, which is correctly int32 and out of scope here. Inside the module the width is applied inconsistently: PaginatedResultsInfo.page is int32 while its siblings pageSize, totalItems, and totalPages are integer, and the request models use int32 for both page and pageSize.
The emitters turn that one int32 into a contract nothing else honors. The JSON Schema emitter writes maximum: 2147483647 on page and on no other pagination field; the OpenAPI emitter writes format: int32. No implementation or tool reads either: cg check spec compares type, enum, properties, required, and items only; the Express, FastAPI, and Hono templates and simpler-grants-gov all validate page as an unbounded or safe integer; the TypeScript SDK's z.number().int() accepts up to 2⁵³−1 and the Python SDK's int is unbounded. The bound exists only in the spec text.
The #1193 parity harness (PR #1195) now surfaces this as a tracked divergence — page: 2147483648 is accepted by the TypeScript SDK and rejected by the protocol — and requires that entry to name the issue that owns the fix. This is that issue. The fix is in Core, not the SDK: widen page to integer so the module is uniform and the divergence disappears.
Change every int32 in pagination.tsp to integer: page and pageSize on PaginatedQueryParams and PaginatedBodyParams, and page on PaginatedResultsInfo. Widening an accepted domain is non-breaking for every existing consumer.
Acceptance criteria
- No
int32remains inlib/core/lib/core/pagination.tsp;pageandpageSizeon the request models andpageonPaginatedResultsInfoareinteger. The response models'status: int32(HTTP status codes) is unchanged. - The emitted JSON Schema for those fields carries
minimum: 1and nomaximum; the emitted OpenAPI carries noformat: int32. - Previously published Core versions (0.1.0 through 0.4.0) emit unchanged; the wider type applies from the next Core version (
@typeChangedFromor equivalent — Core has not versioned a type change before, so record the approach in the PR). - The TypeScript SDK parity harness reflects the fix in the same PR: the
page: 2147483648divergent entry inlib/ts-sdk/__tests__/schemas/zod/pagination.spec.tsis removed (the harness fails demanding removal once the schemas agree) and the same value is re-added as an ordinary agree case, with theknownDivergencesassertion updated. Touchinglib/ts-sdk/__tests__/also triggersci-lib-ts-sdk.yml, which a Core-only change would not.
Evidence and scope
pagination.tsp: the sevenint32declarations and the threeintegersiblings.funding.tsp: theintegerprecedent for counts.check-schema-compatibility.ts: the compliance checker never readsformat,minimum, ormaximum, so this change cannot fail any implementation'scg check spec.- TypeScript SDK
pagination.ts:z.number().int().min(1)— Zod 4 safe-integer semantics, already the correct encoding ofintegerfor JavaScript. No SDK production change is needed, in TypeScript or Python. ci-lib-ts-sdk.yml: path-filtered tolib/ts-sdk/**, hence the requirement that the PR touch the harness test.- The
pageSize >= 1restoration onPaginatedResultsInfoSchemastays with [TS SDK] Consolidate the duplicate sort and pagination param schemas #1130; this issue owns integer width only. The TypeScript SDK's 2⁵³−1 cap is a JavaScript platform fact, not a divergence to track.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
test(ts-sdk): point the page int32 divergence at #1196, its owning Co…
test(ts-sdk): point the page int32 divergence at #1196, its owning Co…
test(ts-sdk): give models, pagination, and responses boundary cases
fix(ts-sdk): catch permissive schema drift and empty parity-test runs (…
fix(sdk): drop the int32 cap from the award-route pagination schemas