From 7f964ad5d24de5b11a711fbd1c9f00217f0bddee Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 1 Feb 2022 16:48:11 +0100 Subject: [PATCH] Fixing JSON serialization --- .../reference/entities/QueryTemplate.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/queries/templates/reference/entities/QueryTemplate.java b/src/main/java/org/gcube/informationsystem/queries/templates/reference/entities/QueryTemplate.java index 66db138..13d2ec7 100644 --- a/src/main/java/org/gcube/informationsystem/queries/templates/reference/entities/QueryTemplate.java +++ b/src/main/java/org/gcube/informationsystem/queries/templates/reference/entities/QueryTemplate.java @@ -46,19 +46,19 @@ public interface QueryTemplate extends EntityElement { public void setDescription(String description); - @JsonGetter(value = TEMPLATE_PROPERTY) + @JsonIgnore @ISProperty(name = TEMPLATE_PROPERTY, description = "The Query Template. It can contains query variables to be replaced to obtain a runnable query.", readonly = false, mandatory = true, nullable = false) public String getTemplateAsString() throws JsonProcessingException; - @JsonSetter(value = TEMPLATE_PROPERTY) + @JsonIgnore public void setTemplate(String template) throws JsonProcessingException, IOException; - @JsonIgnore - public JsonNode getTemplate(); - - @JsonIgnore + @JsonSetter(value = TEMPLATE_PROPERTY) public void setTemplate(JsonNode template); + @JsonGetter(value = TEMPLATE_PROPERTY) + public JsonNode getTemplate(); + @JsonGetter(value = TEMPLATE_VARIABLES_PROPERTY) @ISProperty(name = TEMPLATE_VARIABLES_PROPERTY, description = "The Query Template Variables. It can contains Query Template Variable to be replaced to obtain a runnable query.", readonly = false, mandatory = true, nullable = false) public Map getTemplateVariables(); @@ -76,12 +76,14 @@ public interface QueryTemplate extends EntityElement { * It uses the default values provided in TemplateVariables. * @return the created object node */ + @JsonIgnore public ObjectNode getParamsFromDefaultValues(); /** * @return the JsonQuery replacing the variables using the default values contained in TemplateVariables * @throws Exception */ + @JsonIgnore public JsonNode getJsonQuery() throws Exception; /** @@ -89,6 +91,7 @@ public interface QueryTemplate extends EntityElement { * @return the JsonQuery replacing the variables using the provided values * @throws Exception */ + @JsonIgnore public JsonNode getJsonQuery(JsonNode values) throws Exception;