You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add @link property extraction to extractCSAPIFeature() in geojson.ts — populate the systemKindLink, platformLink, deployedSystemsLink, and sampledFeatureLink interface fields (from #108) with data from raw server JSON.
The extractCSAPIFeature() function in geojson.ts — the sole parser for Part 1 GeoJSON resources — uses a property-name allowlist that silently discards all @link association properties from the raw JSON properties object. Only six hard-coded property names (featureType, uid, name, description, assetType, validTime) survive extraction; all @link inline association references defined by OGC 23-001 are lost.
Impact: Consumers cannot access association data through the library's typed models. The ogc-csapi-explorer had to implement a 105-line tryLinkFallback() workaround that bypasses the library entirely to read @link fields from raw JSON. When servers don't support cross-resource navigation endpoints (e.g., OSH returns 400 for /systems/{id}/procedures), @link is the only mechanism for discovering resource associations.
Findings Report
📄 Issue #109 Findings Report — Full source code review, risk assessment, precedent analysis, and implementation recommendation.
Add test assertions for @link field extraction (present, absent, malformed)
Proposed Fix
Add tolerant conditional-spread extraction for @link properties in three of the four switch cases (Procedure has no @link fields). This follows the identical pattern already proven in the Part 2 parsers (Issue #103, part2.ts L163–164, L256–257).
Helper Functions (private, ~10 lines)
/** Type guard for @link objects — validates href is a string. */functionisCSAPIResourceRef(value: unknown): value is Record<string,unknown>{returntypeofvalue==='object'&&value!==null&&typeof(valueasany).href==='string';}/** Parse a raw @link object into a typed CSAPIResourceRef. */functionparseResourceRef(raw: Record<string,unknown>): CSAPIResourceRef{return{href: String(raw.href),
...(typeofraw.uid==='string' ? {uid: raw.uid} : {}),
...(typeofraw.title==='string' ? {title: raw.title} : {}),
...(typeofraw.rt==='string' ? {rt: raw.rt} : {}),};}
Task
Add
@linkproperty extraction toextractCSAPIFeature()ingeojson.ts— populate thesystemKindLink,platformLink,deployedSystemsLink, andsampledFeatureLinkinterface fields (from #108) with data from raw server JSON.Finding Reference: Demo app finding from ogc-csapi-explorer
tryLinkFallback()workaround (ad06b52) and Gap Analysis ReportSeverity: Moderate
Category: Design gap
Ownership: Ours
Problem Statement
The
extractCSAPIFeature()function ingeojson.ts— the sole parser for Part 1 GeoJSON resources — uses a property-name allowlist that silently discards all@linkassociation properties from the raw JSONpropertiesobject. Only six hard-coded property names (featureType,uid,name,description,assetType,validTime) survive extraction; all@linkinline association references defined by OGC 23-001 are lost.Evidence:
Impact: Consumers cannot access association data through the library's typed models. The ogc-csapi-explorer had to implement a 105-line
tryLinkFallback()workaround that bypasses the library entirely to read@linkfields from raw JSON. When servers don't support cross-resource navigation endpoints (e.g., OSH returns 400 for/systems/{id}/procedures),@linkis the only mechanism for discovering resource associations.Findings Report
📄 Issue #109 Findings Report — Full source code review, risk assessment, precedent analysis, and implementation recommendation.
Files to Create or Modify
src/ogc-api/csapi/formats/geojson.tsCSAPIResourceRefimport, 2 helper functions,@linkextraction in 3 switch casessrc/ogc-api/csapi/formats/geojson.spec.ts@linkfield extraction (present, absent, malformed)Proposed Fix
Add tolerant conditional-spread extraction for
@linkproperties in three of the fourswitchcases (Procedure has no@linkfields). This follows the identical pattern already proven in the Part 2 parsers (Issue #103,part2.tsL163–164, L256–257).Helper Functions (private, ~10 lines)
Extraction Pattern (per switch case)
Design Notes
@linkassociation properties #108 (RESOLVED ✅) — interface fieldssystemKindLink,platformLink,deployedSystemsLink,sampledFeatureLink+CSAPIResourceReftype already existpart2.tsL163–164 uses...(typeof obj['system@id'] === 'string' ? { systemId: ... } : {})?); existing tests pass unchanged@linkdata (missinghref, non-object) is silently skippedScope — What NOT to Touch
model.ts— interface fields already exist (Part 1 (GeoJSON) TypeScript interfaces omit all@linkassociation properties #108, commitf8026ea)part2.ts— Part 2 parser changes belong to separate issuesparent@linkextraction — noparentLinkinterface field exists; tracked separatelysrc/index.ts—CSAPIResourceRefis already exported (Part 1 (GeoJSON) TypeScript interfaces omit all@linkassociation properties #108)basePropertiesextraction or existing code patternsAcceptance Criteria
geojson.tsimportsCSAPIResourceReffrom../model.jsisCSAPIResourceRef()type guard andparseResourceRef()helper exist ingeojson.tssystemKind@link→systemKindLinkplatform@link→platformLinkanddeployedSystems@link→deployedSystemsLinksampledFeature@link→sampledFeatureLink@linkfields)@linkfields survive extraction when present@linkfields areundefinedwhen absent (tolerant extraction)@linkdata is silently skippednpm test)Dependencies
Blocked by: #108 — Part 1 interfaces omit
@linkfields (RESOLVED ✅ commitf8026ea)Blocks: #110 — No
@linkresolution utilities (depends on parser extracting the data)Operational Constraints
Key constraints:
undefinedif absent, never throwReferences
src/ogc-api/csapi/formats/geojson.tsextractCSAPIFeature()L393–472src/ogc-api/csapi/formats/part2.tsL163–164, L256–257@idextraction pattern (proven precedent)src/ogc-api/csapi/model.tsL117–127, L345–475@linkfields from #108@linkproperties on Part 1 resourcesRelated Issues
@linkassociation properties #108 — Part 1 interfaces omit@linkfields (RESOLVED ✅ — prerequisite)@link/@idresolution utilities for cross-resource reference following #110 — No@linkresolution utilities (downstream — depends on this issue)