Skip to content

Commit 97f72ac

Browse files
committed
fix: Correct syntax errors in temporal validation integration (Phase 3 corrective)
Fixes syntax errors in validateDeploymentFeature, validateProcedureFeature, and validateSamplingFeature where temporal validation code was incorrectly inserted into the middle of error message string literals in commit 259ecf6. The temporal validation blocks for validTime, validTime, and samplingTime were malformed - they were placed inside template literals instead of after the featureType check, causing JavaScript syntax errors that prevented the file from compiling and tests from running. Test results after fix: - PASS src/ogc-api/csapi/validation/geojson-validator.spec.ts - All 22 temporal validation tests now passing - No regressions introduced (same 5 pre-existing test suite failures) Issue camptocamp#70
1 parent 259ecf6 commit 97f72ac

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/ogc-api/csapi/validation/geojson-validator.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -686,13 +686,13 @@ export function validateDeploymentFeature(data: unknown): ValidationResult {
686686

687687
const props = data.properties as any;
688688
if (props.featureType !== 'Deployment') {
689-
errors.push(`Expected featureType 'Deployment', got '${props.featureType}
689+
errors.push(`Expected featureType 'Deployment', got '${props.featureType}'`);
690+
}
690691

691692
// Validate validTime if present
692693
if (props.validTime) {
693694
const validTimeErrors = validateTemporal(props.validTime, 'validTime');
694695
errors.push(...validTimeErrors);
695-
}'`);
696696
}
697697

698698
if (!props.system) {
@@ -759,13 +759,13 @@ export function validateProcedureFeature(data: unknown): ValidationResult {
759759

760760
const props = data.properties as any;
761761
if (props.featureType !== 'Procedure') {
762-
errors.push(`Expected featureType 'Procedure', got '${props.featureType}
762+
errors.push(`Expected featureType 'Procedure', got '${props.featureType}'`);
763+
}
763764

764765
// Validate validTime if present
765766
if (props.validTime) {
766767
const validTimeErrors = validateTemporal(props.validTime, 'validTime');
767768
errors.push(...validTimeErrors);
768-
}'`);
769769
}
770770

771771
// Validate links array if present
@@ -911,13 +911,13 @@ export function validateSamplingFeature(data: unknown): ValidationResult {
911911

912912
const props = data.properties as any;
913913
if (props.featureType !== 'SamplingFeature') {
914-
errors.push(`Expected featureType 'SamplingFeature', got '${props.featureType}
914+
errors.push(`Expected featureType 'SamplingFeature', got '${props.featureType}'`);
915+
}
915916

916917
// Validate samplingTime if present
917918
if (props.samplingTime) {
918919
const samplingTimeErrors = validateTemporal(props.samplingTime, 'samplingTime');
919920
errors.push(...samplingTimeErrors);
920-
}'`);
921921
}
922922

923923
// Validate geometry

0 commit comments

Comments
 (0)