-
Notifications
You must be signed in to change notification settings - Fork 1
parseControlStreamSchemaResponse() does not accept paramsSchema — silent data loss on older OSH servers #140
Description
Summary
parseControlStreamSchemaResponse() in src/ogc-api/csapi/formats/schema-response.ts only looks for parametersSchema in the server response object. OpenSensorHub servers built from older source commits use paramsSchema as the JSON property name instead. When parsing a response from such a server, the function silently returns parametersSchema: undefined — no error is thrown, but the schema data is lost.
Discovery
Discovered during Oracle Cloud smoke testing via javap -c -p bytecode decompilation of compiled OSH server JARs. The compiled CommandStreamSchemaBindingJson.class contains the string literal "paramsSchema" (not "parametersSchema"), and CommandBindingJson.class contains "params" (not "parameters").
Affected Code
Upstream PR (camptocamp#136):
// schema-response.ts line ~160
const rawParametersSchema = obj.parametersSchema;
// ^^^^^^^^^^^^^^^^ — only this nameFix (already applied in ogc-csapi-explorer):
// Accept both "parametersSchema" (newer OSH / OGC spec) and "paramsSchema" (older OSH builds)
const rawParametersSchema = obj.parametersSchema ?? obj.paramsSchema;Cross-Server Evidence
| Server | Build | Property Name |
|---|---|---|
| Oracle Cloud OSH (129.80.248.53) | Built from source (osh-core@e74e12e2) | paramsSchema |
| DigitalOcean OSH (45.55.99.236) | Pre-built distribution | parametersSchema |
| 52°North CSA Demo | Different implementation | parametersSchema |
Impact
- Silent data loss: consumers receive
undefinedinstead of the actual schema - Affects any OSH server running JARs built before the property was renamed
- The
parseDatastreamSchemaResponse()function is NOT affected (its property names are consistent across builds)
Proposed Fix
- Add
?? obj.paramsSchemafallback inparseControlStreamSchemaResponse() - Add a unit test with a fixture using
paramsSchema - Add JSDoc noting the dual-name pattern
Findings Report
Full findings report with bytecode evidence, cross-server comparison, and analysis:
docs/research/phase-6/findings/osh-server-property-name-divergence.md