Skip to content

Commit 4f3a7b7

Browse files
committed
docs(csapi): document pagination contract on list methods (A4 / #167)
Phase 8 / Task A4 / Finding #167. Adds a centralized "## Pagination" section to the CSAPIQueryBuilder class docblock and a "@remarks Pagination" block to every list method on the class. Locked decision (per #167): docs-only. No behavior change. No auto-pagination helper. The opt-in async-iterator / followNext helper is deferred to #170. Class docblock anchor inserted between "## Resource Discovery" / "## Error Handling" sections, covering: - server-chosen default page size (varies by impl: connected-systems-go defaults to limit=10; OpenSensorHub defaults to limit=100) - rel="next" HATEOAS links in response body - explicit pointer to the deferred helper in #170 39 list methods received the per-method @remarks block (the issue requires ">=16"; touching every list method satisfies the spirit of the issue and avoids future audit drift): Top-level: getSystems, getDeployments, getProcedures, getSamplingFeatures, getProperties, getDatastreams, getObservations, getControlStreams, getCommands. Association: getSystemHistory, getSystemSubsystems, getSystemDatastreams, getSystemControlStreams, getSystemSamplingFeatures, getSystemDeployments, getSystemProcedures, getDeploymentSubdeployments, getDeploymentSystems, getDeploymentHistory, getProcedureSystems, getProcedureDatastreams, getProcedureHistory, getSamplingFeatureSystems, getSamplingFeatureObservations, getSamplingFeatureHistory, getPropertySystems, getPropertyDatastreams, getPropertyControlStreams, getPropertyHistory, getDatastreamObservations, getDatastreamSystems, getDatastreamProcedures, getDatastreamHistory, getObservationHistory, getControlStreamCommands, getControlStreamSystems, getControlStreamProcedures, getControlStreamHistory, getCommandStatus. Single-resource getters and create/update/delete methods are intentionally NOT touched. No method signatures, return types, or runtime behavior changed. Refs: docs/planning/P8-implementation-guide.md (Task A4) Closes #167
1 parent f3ebcbc commit 4f3a7b7

3 files changed

Lines changed: 282 additions & 1 deletion

File tree

‎src/ogc-api/csapi/index.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@
4242
* const datastreams = body.items.map(parseDatastream);
4343
* ```
4444
*
45+
* ## Pagination
46+
*
47+
* All `get*()` list methods follow the OGC API Common pagination contract:
48+
* the **server** picks the default page size when `limit` is unspecified
49+
* (defaults vary — `connected-systems-go` returns 10, OpenSensorHub returns
50+
* 100), and the consumer is responsible for following `rel: "next"` links
51+
* from the response body's `links` array to retrieve subsequent pages.
52+
* This module does **not** auto-paginate. See
53+
* [`integration/observation.spec.ts`](./integration/observation.spec.ts)
54+
* for the canonical link-walking pattern, and the
55+
* {@link CSAPIQueryBuilder} class docblock for the full contract. An
56+
* opt-in async-iterator helper is deferred to issue
57+
* [#170](https://github.com/OS4CSAPI/ogc-client-CSAPI_2/issues/170).
58+
*
4559
* @see {@link CSAPIQueryBuilder} — all available URL-building methods
4660
* @see {@link createCSAPIBuilder} — the factory entry point
4761
* @see https://docs.ogc.org/is/23-001/23-001.html — OGC API CS Part 1

‎src/ogc-api/csapi/model.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,16 @@ export interface CSAPIResourceRef {
170170
* @see https://docs.ogc.org/is/23-001/23-001.html#_query_parameters
171171
*/
172172
export interface QueryOptions {
173-
/** Maximum number of resources to return. */
173+
/**
174+
* Maximum number of resources to return.
175+
*
176+
* Optional. When omitted, the server applies its own default page size,
177+
* which varies by implementation (`connected-systems-go` defaults to
178+
* `limit=10`; OpenSensorHub defaults to `limit=100`). To retrieve all
179+
* results, follow the `next` link in the response body's `links` array.
180+
* See the Pagination section of {@link CSAPIQueryBuilder}'s class
181+
* docblock for the full pagination contract.
182+
*/
174183
limit?: number;
175184
/** Offset-based pagination: number of resources to skip. */
176185
offset?: number;

0 commit comments

Comments
 (0)