diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2018-11-30 17:57:02 +0530 |
---|---|---|
committer | Sandeep J <sandeejh@in.ibm.com> | 2018-11-30 17:57:16 +0530 |
commit | 62a2e1dc1c376895ee6fcbc819a1a0010199e58d (patch) | |
tree | dac5a74c3ff2406e60d280633b2eeb26bdb9a295 | |
parent | 99b797bba200f9d91a8f6224697e9a18132b3dbd (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>
-rw-r--r-- | ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java | 12 |
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 81f7d701..77de8e7c 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) -> {
|