From f9663e0063d7626be0963ff1fb487fcf214a2f91 Mon Sep 17 00:00:00 2001 From: Marco Hutter Date: Sat, 15 Feb 2025 15:49:09 +0100 Subject: [PATCH] Use INFO instead of WARNING for unhandled content types --- specs/extensions/MaxarContentGeojonValidationSpec.ts | 8 ++++---- src/validation/ContentDataValidators.ts | 8 ++++---- src/validation/Validators.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/specs/extensions/MaxarContentGeojonValidationSpec.ts b/specs/extensions/MaxarContentGeojonValidationSpec.ts index 57ff9eb1..69d19882 100644 --- a/specs/extensions/MaxarContentGeojonValidationSpec.ts +++ b/specs/extensions/MaxarContentGeojonValidationSpec.ts @@ -5,11 +5,11 @@ describe("Tileset MAXAR_content_geojson extension validation", function () { const result = await Validators.validateTilesetFile( "specs/data/extensions/maxarContentGeojson/validTilesetWithGeojson.json" ); - // Expect one warning for skipping the GeoJSON validation + // Expect one info for skipping the GeoJSON validation // and one for the missing declaration of the // MAXAR_content_geojson usage in the extensionsUsed expect(result.length).toEqual(2); - expect(result.get(0).type).toEqual("CONTENT_VALIDATION_WARNING"); + expect(result.get(0).type).toEqual("CONTENT_VALIDATION_INFO"); expect(result.get(1).type).toEqual("EXTENSION_FOUND_BUT_NOT_USED"); }); @@ -17,8 +17,8 @@ describe("Tileset MAXAR_content_geojson extension validation", function () { const result = await Validators.validateTilesetFile( "specs/data/extensions/maxarContentGeojson/validTilesetWithMaxarContentGeojson.json" ); - // Expect one warning for skipping the GeoJSON validation + // Expect one info for skipping the GeoJSON validation expect(result.length).toEqual(1); - expect(result.get(0).type).toEqual("CONTENT_VALIDATION_WARNING"); + expect(result.get(0).type).toEqual("CONTENT_VALIDATION_INFO"); }); }); diff --git a/src/validation/ContentDataValidators.ts b/src/validation/ContentDataValidators.ts index 1330f575..f6e6bde8 100644 --- a/src/validation/ContentDataValidators.ts +++ b/src/validation/ContentDataValidators.ts @@ -82,7 +82,7 @@ export class ContentDataValidators { // Certain content types are known to be encountered, // but are not (yet) validated. These can either be - // ignored, or cause a warning. In the future, this + // ignored, or cause an info. In the future, this // should be configurable, probably even on a per-type // basis, via the command line or a config file const ignoreUnhandledContentTypes = false; @@ -90,13 +90,13 @@ export class ContentDataValidators { let vctrValidator = Validators.createEmptyValidator(); let geojsonValidator = Validators.createEmptyValidator(); if (!ignoreUnhandledContentTypes) { - geomValidator = Validators.createContentValidationWarning( + geomValidator = Validators.createContentValidationInfo( "Skipping 'geom' validation" ); - vctrValidator = Validators.createContentValidationWarning( + vctrValidator = Validators.createContentValidationInfo( "Skipping 'vctr' validation" ); - geojsonValidator = Validators.createContentValidationWarning( + geojsonValidator = Validators.createContentValidationInfo( "Skipping 'geojson' validation" ); } diff --git a/src/validation/Validators.ts b/src/validation/Validators.ts index da087c85..468c1b73 100644 --- a/src/validation/Validators.ts +++ b/src/validation/Validators.ts @@ -393,18 +393,18 @@ export class Validators { } /** - * Creates a `Validator` that only adds a `CONTENT_VALIDATION_WARNING` + * Creates a `Validator` that only adds a `CONTENT_VALIDATION_INFO` * with the given message to the given context when it is called. * * This is used for "dummy" validators that handle content data types * that are already anticipated (like VCTR or GEOM), but not validated * explicitly. * - * @param message - The message for the warning + * @param message - The message for the info * @returns The new validator * @internal */ - static createContentValidationWarning(message: string): Validator { + static createContentValidationInfo(message: string): Validator { return { async validateObject( inputPath: string, @@ -412,7 +412,7 @@ export class Validators { input: Buffer, context: ValidationContext ): Promise { - const issue = ContentValidationIssues.CONTENT_VALIDATION_WARNING( + const issue = ContentValidationIssues.CONTENT_VALIDATION_INFO( inputPath, message );