summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-11-30 17:57:02 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-11-30 17:57:16 +0530
commit58a60b154e08c7b210df0c1fb72999e79477d745 (patch)
treec07864cf5c61189f5e95b5b68fbc58e1874c0083 /ms/controllerblueprints
parent4b85a8e36c40b4d8ec8199c3467c3cc179ecf35d (diff)
fixed sonar issues in SwaggerGenerator.java
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: I50b6b8ac8676294f70be1a98755e0069dd489b5a Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
index 81f7d7018..77de8e7cf 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2018 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,6 +41,7 @@ import java.util.*;
public class SwaggerGenerator {
private ServiceTemplate serviceTemplate;
+ public static final String INPUTS="inputs";
/**
* This is a SwaggerGenerator constructor
@@ -54,8 +56,7 @@ public class SwaggerGenerator {
* @return String
*/
public String generateSwagger() {
- String swaggerContent = null;
-
+
Swagger swagger = new Swagger().info(getInfo());
swagger.setPaths(getPaths());
@@ -86,7 +87,7 @@ public class SwaggerGenerator {
List<Parameter> parameters = new ArrayList<>();
Parameter in = new BodyParameter().schema(new RefModel("#/definitions/inputs"));
in.setRequired(true);
- in.setName("inputs");
+ in.setName(INPUTS);
parameters.add(in);
post.setParameters(parameters);
@@ -107,18 +108,17 @@ public class SwaggerGenerator {
Map<String, Model> models = new HashMap<>();
ModelImpl inputmodel = new ModelImpl();
- inputmodel.setTitle("inputs");
+ inputmodel.setTitle(INPUTS);
serviceTemplate.getTopologyTemplate().getInputs().forEach((propertyName, property) -> {
Property defProperty = getPropery(propertyName, property);
inputmodel.property(propertyName, defProperty);
});
- models.put("inputs", inputmodel);
+ models.put(INPUTS, inputmodel);
if (MapUtils.isNotEmpty(serviceTemplate.getDataTypes())) {
serviceTemplate.getDataTypes().forEach((name, dataType) -> {
ModelImpl model = new ModelImpl();
model.setDescription(dataType.getDescription());
- // model.setType("object");
if (dataType != null && MapUtils.isNotEmpty(dataType.getProperties())) {
dataType.getProperties().forEach((propertyName, property) -> {