Repository navigation
Description
⚠️ This issue has been split into two parts for safe execution
Per the Phase 7 Scope & Split Assessment, this issue requires removing assertResourceAvailable() from 72 per-ID methods in a 2,490-line file. Doing 72 identical one-line deletions in a single pass risks dropped edits. The methods are grouped by resource type, providing natural split points.
Split Issues
| Part | Issue | Scope |
|---|---|---|
| Part 1 | #156 | Systems (14) + Deployments (7) + Procedures (6) + SamplingFeatures (6) = 33 methods |
| Part 2 | #157 | Properties (5) + Datastreams (9) + Observations (7) + ControlStreams (9) + Commands (9) = 39 methods |
Execution Order
- #100 Part 1: Remove
assertResourceAvailablefrom per-ID methods — Systems, Deployments, Procedures, SamplingFeatures (33 methods) #156 (Part 1) — remove asserts from Part 1 resource per-ID methods - #100 Part 2: Remove
assertResourceAvailablefrom per-ID methods — Properties, Datastreams, Observations, ControlStreams, Commands (39 methods) #157 (Part 2) — remove asserts from Part 2 resource + Properties per-ID methods
This parent issue should be closed when both #156 and #157 are resolved.
Original issue body (preserved for reference)
Summary
Every public method in CSAPIQueryBuilder — including per-ID methods like getDataStream(id), getDataStreamSchema(id), and getControlStream(id) — calls assertResourceAvailable() before constructing the URL. This guard throws EndpointError if the resource type was not discovered as a top-level link during builder construction, even when the caller already has a valid resource ID and the URL pattern is completely deterministic.
This makes the URL builder unusable for Part 2 resources (datastreams, observations, controlStreams, commands) on servers that only advertise these types as nested paths under systems — which is the common case for OGC Connected Systems servers.
Observed Behavior
Server: OpenSensorHub at http://45.55.99.236:8080/sensorhub/api
The OSH server advertises datastreams only as nested links under /systems/{id}/datastreams, not as a top-level /datastreams endpoint. During builder construction, scanCsapiLinks() does not find datastreams as a top-level link, so availableResources does not include it.
// ❌ Throws EndpointError even though the URL would be perfectly valid:
builder.getDataStreamSchema('03tbj7mvqg50')
// EndpointError: Collection 'csapi-explorer' does not support 'datastreams' resource.
// Available resources: systems, deployments, procedures, samplingFeatures, properties
// The URL it WOULD construct is completely valid:
// → /datastreams/03tbj7mvqg50/schema ← works fine when fetched directlyRoot Cause
assertResourceAvailable() conflates two distinct concerns:
- "Can I list all resources of this type?" — Requires a top-level collection endpoint. Guard is appropriate.
- "Can I construct a URL for a specific resource by ID?" — The URL is deterministic from type + ID. Guard is inappropriate.
Scope of Impact
Of the 87 methods (updated count) that call assertResourceAvailable():
- 15 are collection/list methods (no ID parameter) — guard is reasonable
- 72 are per-ID methods — guard is overly strict
Activity
docs: add Issue #99 findings report — ?f= parameter already supported
docs(findings): add Issue #100 findings report — assertResourceAvaila…
Sam-Bolling commentedon Feb 21, 2026
Findings Report Filed
A detailed findings report has been completed for this issue:
📄 Issue #100 Findings Report — assertResourceAvailable() for Per-ID Methods
Key Findings
assertResourceAvailable()blocks 69 per-ID methods when Part 2 resources aren't discovered as top-level linksresourceUrlsconstructor parameter is the designed escape hatch for exactly this scenariobuildResourceUrl()already has graceful fallback logic — it would produce valid URLs if the assertion were removedRecommendation: DEFER
Valid enhancement, wrong timing. The behavior is intentional and documented, a workaround exists (
resourceUrlsconstructor param), and the change is too invasive (69 method changes + 57+ test updates) to risk before the upstream contribution submission. Recommend revisiting post-contribution.See the full report for authority precedence analysis, risk assessment, and implementation guidance if the change is pursued later.
[-]assertResourceAvailable() is overly strict for per-ID methods — blocks valid URL construction for nested resources[/-][+][DEFERRED] assertResourceAvailable() is overly strict for per-ID methods — blocks valid URL construction for nested resources[/+]docs: add Issue #102 findings report — command/observation nested pat…
docs: add Phase 5.5 code review (Issues #99-#110 post-smoke-test)
docs: add deferred issues Phase 6 scope assessment
docs: add Phase 7 scope & split assessment report
[-][DEFERRED] assertResourceAvailable() is overly strict for per-ID methods — blocks valid URL construction for nested resources[/-][+][SPLIT] assertResourceAvailable() overly strict for per-ID methods → #156 + #157[/+]docs: update P7 plan v1.3 — reflect issue splits (#141→#154+#155, #100→…
remove assertResourceAvailable from 33 per-ID methods — Part 1 (#100)
Sam-Bolling commentedon Mar 7, 2026
Both split issues are now resolved and closed:
assertResourceAvailablefrom per-ID methods — Systems, Deployments, Procedures, SamplingFeatures (33 methods) #156 (Part 1 — Systems, Deployments, Procedures, SamplingFeatures — 33 methods) — closedassertResourceAvailablefrom per-ID methods — Properties, Datastreams, Observations, ControlStreams, Commands (39 methods) #157 (Part 2 — Properties, Datastreams, Observations, ControlStreams, Commands — 39 methods) — closedAll 72 per-ID methods no longer call
assertResourceAvailable(). The 15 list/create methods retain their guards as intended. Closing this parent issue.docs(implementation): add ST#24 live server smoke test report (Phase 7)