aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
authorChristophe Closset <christophe.closset@intl.att.com>2020-04-23 08:49:36 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-23 08:49:36 +0000
commit6c42be8a5b9a90c3a2c2907174d4264cf5606ac4 (patch)
tree1fa699ffdd06a65c79cf1e76103429d3bf347f81 /src/main/java/org/onap
parente57ccc972e080ce039d7a1325332fcae3b75bbf1 (diff)
parentab9bc444f84f2cbb89747543657de3a54e4554b8 (diff)
Merge "Fix entityId bug"
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java11
1 files changed, 11 insertions, 0 deletions
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 690b7ae12..8bd8aac75 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -138,6 +138,15 @@ public class OperationalPolicyRepresentationBuilder {
return vnfSchemaArray;
}
+ private static JsonArray createBlankEntry() {
+ JsonArray result = new JsonArray();
+ JsonObject blankObject = new JsonObject();
+ blankObject.addProperty("title", "User defined");
+ blankObject.add("properties", new JsonObject());
+ result.add(blankObject);
+ return result;
+ }
+
private static JsonArray createVfModuleSchema(Service modelService, boolean generateType) {
JsonArray vfModuleOneOfSchemaArray = new JsonArray();
JsonObject modelVfModules = modelService.getResourceByType("VFModule");
@@ -190,6 +199,8 @@ public class OperationalPolicyRepresentationBuilder {
*/
public static JsonArray createAnyOfArray(Service modelJson, boolean generateType) {
JsonArray targetOneOfStructure = new JsonArray();
+ // First entry must be user defined
+ targetOneOfStructure.addAll(createBlankEntry());
targetOneOfStructure.addAll(createVnfSchema(modelJson, generateType));
targetOneOfStructure.addAll(createVfModuleSchema(modelJson, generateType));
return targetOneOfStructure;