diff options
author | YuanHu <yuan.hu1@zte.com.cn> | 2018-04-13 08:56:42 +0800 |
---|---|---|
committer | YuanHu <yuan.hu1@zte.com.cn> | 2018-04-17 14:24:17 +0800 |
commit | 84372056e279fbc8a5df3d8e0e60b3b0919e4362 (patch) | |
tree | 99f804308dd003fb62a5fc3558bf653305582460 /sdc-workflow-designer-server/src/main | |
parent | e789e3060b7860075820af76a71e6dfc050cc286 (diff) |
Json Serialize 'clazz' to 'class'
Add @JsonProperty(value="class") to field 'clazz' to indicate the Json Serialize name.
Issue-ID: SDC-1235
Change-Id: I21de7514a9d6c8f7227b25d8c8c9ecf4e9c35171
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server/src/main')
5 files changed, 12 insertions, 36 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java index e5b065ec..34a17e70 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java @@ -12,7 +12,6 @@ package org.onap.sdc.workflowdesigner; -//import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.onap.sdc.workflowdesigner.config.AdapterType; import org.onap.sdc.workflowdesigner.config.AppConfig; import org.onap.sdc.workflowdesigner.resources.ExtendActivityResource; @@ -61,8 +60,6 @@ public class WorkflowDesignerApp extends Application<WorkflowDesignerConfigurati // register rest interface environment.jersey().packages("org.onap.sdc.workflowdesigner.resources"); -// // upload file by inputstream need to register MultiPartFeature -// environment.jersey().register(MultiPartFeature.class); initSwaggerConfig(environment, configuration); diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java index e97fd8e2..66208a2c 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java @@ -11,32 +11,21 @@ */
package org.onap.sdc.workflowdesigner.externalservice.sdc.entity;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
/**
*
*/
public class ActivityContent {
- @SerializedName("class")
- private String clazz;
+ @JsonProperty(value="class") // for dropwizard's Jackson
+ @SerializedName("class") // for Gson
+ public String clazz;
private String scriptFormat;
private String script;
- /**
- * @return the clazz
- */
- public String getClazz() {
- return clazz;
- }
-
- /**
- * @param clazz the clazz to set
- */
- public void setClazz(String clazz) {
- this.clazz = clazz;
- }
/**
* @return the scriptFormat
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java index 2ce45fa0..35a1a36e 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java @@ -25,7 +25,7 @@ public class ActivitySpec { private String type;
- private ActivityContent content;
+ private ActivityContent content = new ActivityContent();
private String[] categoryList;
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java index 46fef111..99e2f28a 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java @@ -160,7 +160,8 @@ public class ExtendActivityResource { */ private Content buildContent(ActivitySpec activitySpec) { Content content = new Content(); - content.setClass(activitySpec.getContent().getClazz()); +// content.setClass(activitySpec.getContent().getClazz()); + content.clazz = activitySpec.getContent().clazz; content.setScript(activitySpec.getContent().getScript()); content.setScriptFormat(activitySpec.getContent().getScriptFormat()); content.setInputs(convert2InputOutputs(activitySpec.getInputs())); diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java index 5a246624..70d59928 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java @@ -13,14 +13,16 @@ package org.onap.sdc.workflowdesigner.resources.entity; import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
/**
*
*/
public class Content {
- @SerializedName("class")
- private String clazz;
+ @JsonProperty(value="class") // for dropwizard's Jackson
+ @SerializedName("class") // for Gson
+ public String clazz;
private String script;
@@ -29,20 +31,7 @@ public class Content { private Map<String, InputOutput> inputs;
private Map<String, InputOutput> outputs;
-
- /**
- * @return the clazz
- */
- public String getClazz() {
- return clazz;
- }
-
- /**
- * @param clazz the clazz to set
- */
- public void setClass(String clazz) {
- this.clazz = clazz;
- }
+
/**
* @return the script
|