From 3eba43d76cf41205d12c0c930b7a16bc24f98875 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Tue, 30 Jul 2024 13:23:42 +0200 Subject: Make full context scan work with schema.translator.list=schema-service - conditionally hide schema.translator.list=config related beans Issue-ID: AAI-3939 Signed-off-by: Fiete Ostkamp Change-Id: I1046f4de1566923118ca2b9bb891caa759c387a5 --- .../src/main/java/org/onap/aai/validation/VersionValidator.java | 4 +++- .../main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java | 4 +++- .../src/main/java/org/onap/aai/validation/nodes/NodeValidator.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'aai-schema-ingest/src/main/java/org') diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/VersionValidator.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/VersionValidator.java index 375bec0f..a1e95557 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/VersionValidator.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/VersionValidator.java @@ -1,4 +1,4 @@ -/** +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ @@ -21,6 +21,7 @@ package org.onap.aai.validation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; /** @@ -28,6 +29,7 @@ import org.springframework.stereotype.Component; * all required versions */ @Component +@ConditionalOnProperty(name = "schema.translator.list", havingValue = "config", matchIfMissing = true) public class VersionValidator { private SchemaErrorStrategy strat; private VersionValidationModule verMod; diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java index 4eedaa07..620bc726 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java @@ -1,4 +1,4 @@ -/** +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ @@ -31,12 +31,14 @@ import org.onap.aai.setup.ConfigTranslator; import org.onap.aai.setup.SchemaVersion; import org.onap.aai.validation.SchemaErrorStrategy; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; /** * Runs all validations against the ingested schema */ @Component +@ConditionalOnProperty(name = "schema.translator.list", havingValue = "config", matchIfMissing = true) public class EdgeRuleValidator { private Map> versionJsonFilesMap; private final SchemaErrorStrategy strat; diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java index ac9ecbdd..13de6715 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java @@ -1,4 +1,4 @@ -/** +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ @@ -27,9 +27,11 @@ import org.onap.aai.setup.ConfigTranslator; import org.onap.aai.setup.SchemaVersion; import org.onap.aai.validation.SchemaErrorStrategy; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @Component +@ConditionalOnProperty(name = "schema.translator.list", havingValue = "config", matchIfMissing = true) public class NodeValidator { private ConfigTranslator translator; -- cgit 1.2.3-korg