diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java index 355a889e0..528d695c3 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -152,6 +152,7 @@ public class OperationalPolicy extends Policy implements Serializable { /** * This method can generate a Json representation (json schema) for an operational policy. * This is mainly to support a legacy case and a generic case. + * For the legacy case the operational policy given is modified (configurationJson). * * @param operationalPolicy The operational policy * @param toscaConverter The tosca converter @@ -166,7 +167,7 @@ public class OperationalPolicy extends Policy implements Serializable { } if (operationalPolicy.isLegacy()) { // Op policy Legacy case - LegacyOperationalPolicy.preloadConfiguration(jsonReturned, operationalPolicy.loop); + LegacyOperationalPolicy.preloadConfiguration(operationalPolicy.getConfigurationsJson(), operationalPolicy.loop); jsonReturned = OperationalPolicyRepresentationBuilder .generateOperationalPolicySchema(operationalPolicy.loop.getModelService()); } diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java index 0298cfde7..c88c1b984 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java @@ -52,15 +52,13 @@ public class OperationalPolicyRepresentationBuilder { JsonObject jsonSchema = JsonUtils.GSON.fromJson( ResourceFileUtil.getResourceAsString("clds/json-schema/operational_policies/operational_policy.json"), JsonObject.class); - jsonSchema.get("schema").getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject() - .get("configurationsJson").getAsJsonObject().get("properties").getAsJsonObject() + jsonSchema.get("properties").getAsJsonObject() .get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies") .getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("target") .getAsJsonObject().get("anyOf").getAsJsonArray().addAll(createAnyOfArray(modelJson)); // update CDS recipe and payload information to schema - JsonArray actors = jsonSchema.get("schema").getAsJsonObject().get("items").getAsJsonObject().get("properties") - .getAsJsonObject().get("configurationsJson").getAsJsonObject().get("properties").getAsJsonObject() + JsonArray actors = jsonSchema.get("properties").getAsJsonObject() .get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies") .getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("actor") .getAsJsonObject().get("anyOf").getAsJsonArray(); |