Skip to content

Audit T1.6: SWE Common 3.0 JSON SchemasΒ #22

@Sam-Bolling

Description

@Sam-Bolling

Audit: SWE Common 3.0 JSON Schemas

Parent Issue: #16 - Phase 6: Pre-Submission Audit
Tier: 1 - OGC Official Specifications (PRIMARY) 🎯
Reference: https://schemas.opengis.net/sweCommon/3.0/
Priority: CRITICAL

Audit Status: βœ… COMPLETE
Overall Result: ⚠️ PARTIAL COMPLIANCE - CRITICAL DISCREPANCIES FOUND
Audit Date: January 26, 2026
Overall Grade: ⚠️ B- (Partial Compliance)


πŸ“‹ Audit Summary

Critical Findings

  • ❌ Required vs Optional Properties - definition and label incorrectly marked optional (should be required)
  • ❌ SoftNamedProperty - name marked optional (should be required)
  • ❌ Vector referenceFrame - Marked optional (should be required)
  • ❌ UnitReference Validation - Missing anyOf validation (must have code OR href)
  • ⚠️ AllowedValues Property Names - interval vs intervals mismatch
  • ⚠️ AllowedTokens Type - Missing separate interface for text/category constraints

Positive Findings βœ…

  • βœ… All property names match JSON schemas (camelCase)
  • βœ… All component type discriminators correct
  • βœ… Nested structures properly modeled
  • βœ… Comprehensive type guards exist
  • βœ… Constraint validation implemented (Issue Audit T1.5: SWE Common 3.0 HTML SpecificationΒ #21)
  • βœ… All types properly exported

Execution Status

  • JSON Schemas Downloaded
  • Schema Files Reviewed
  • TypeScript Interfaces Compared
  • Audit Complete
  • Findings Documented
  • Critical Issues Identified
  • Evidence Links Added

Detailed findings posted in comment below ⬇️


Compliance Matrix

Component Properties Types Required/Optional Overall
AbstractDataComponent βœ… βœ… ❌ ⚠️ PARTIAL
Boolean βœ… βœ… ❌ ⚠️ PARTIAL
Text βœ… ⚠️ ❌ ⚠️ PARTIAL
Category βœ… ⚠️ ❌ ⚠️ PARTIAL
Count βœ… βœ… ❌ ⚠️ PARTIAL
Quantity βœ… βœ… ❌ ⚠️ PARTIAL
Time βœ… βœ… ❌ ⚠️ PARTIAL
DataRecord βœ… βœ… ⚠️ ⚠️ PARTIAL
Vector βœ… βœ… ❌ ⚠️ PARTIAL
DataArray βœ… βœ… βœ… βœ… PASS
DataChoice βœ… βœ… ⚠️ ⚠️ PARTIAL
Range Components βœ… βœ… ❌ ⚠️ PARTIAL

Priority Recommendations

Priority 1: CRITICAL FIXES (Breaking Changes)

  1. Make definition and label required in AbstractDataComponent
  2. Make name required in SoftNamedProperty
  3. Make referenceFrame required in VectorComponent
  4. Fix AllowedValues property names (interval β†’ intervals)

Priority 2: Type Safety Improvements

  1. Add AllowedTokens interface for Text/Category constraints
  2. Add AllowedTimes interface for Time constraints
  3. Improve UnitReference type to enforce code OR href
  4. Add missing JSON Schema properties

Priority 3: Documentation

  1. Add JSDoc comments referencing JSON schema requirements
  2. Document required vs optional in interface comments
  3. Create migration guide for breaking changes

Implementation Strategy

Recommended: Strict Compliance (Option 1)

  • Make all breaking changes in major version bump (2.0.0)
  • Update all interfaces to match JSON schemas exactly
  • Update test fixtures and validation logic
  • Provide migration guide

See detailed findings in comment for full analysis and recommendations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions