aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src/main/java
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-11-30 23:30:17 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-30 23:30:17 +0000
commitd5179dddf09db56edff9690584764b5c08d06ca4 (patch)
tree851d52d4bc782e76f9287a9a46b2e8337e2d30a8 /ms/controllerblueprints/modules/service/src/main/java
parenta195eccc5b2fcd6cadd28ebf9e59febad0461a56 (diff)
parent62a2e1dc1c376895ee6fcbc819a1a0010199e58d (diff)
Merge "fixed sonar issues in SwaggerGenerator.java"
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/main/java')
-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 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) -> {