diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-07-30 13:23:42 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-07-30 13:23:42 +0200 |
commit | 3eba43d76cf41205d12c0c930b7a16bc24f98875 (patch) | |
tree | 8cf047ebc908da126b0f94d19fa4e381b9a1186c | |
parent | 2513e6ea205ca1a6d1c7ba13b8b448ab649966c2 (diff) |
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 <Fiete.Ostkamp@telekom.de>
Change-Id: I1046f4de1566923118ca2b9bb891caa759c387a5
3 files changed, 9 insertions, 3 deletions
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<SchemaVersion, List<DocumentContext>> 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; |