Skip to content

Commit

Permalink
corrected serialization for hashmap
Browse files Browse the repository at this point in the history
  • Loading branch information
sbansla committed Nov 6, 2023
1 parent 998bb01 commit b809201
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 1 addition & 5 deletions src/main/java/com/twilio/rest/content/v1/Content.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.twilio.base.Resource;
import com.twilio.converter.Converter;
import com.twilio.converter.DateConverter;
import com.twilio.exception.ApiConnectionException;

Expand Down Expand Up @@ -378,10 +377,7 @@ static public class ContentCreateRequest {

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonProperty("variables")
@Getter @Setter private Map<String, Object> variables;
public String getVariables() {
return Converter.mapToJson(variables);
}
@Getter @Setter private Map<String, String> variables;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonProperty("language")
@Getter @Setter private String language;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.twilio.base.Resource;
import com.twilio.converter.Converter;
import com.twilio.exception.ApiConnectionException;

import com.twilio.exception.ApiException;
Expand Down Expand Up @@ -66,9 +65,6 @@ public String getTo() {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonProperty("ContentVariables")
@Getter @Setter private Map<String, String> contentVariables;
public String getContentVariables() {
return Converter.mapToJson(contentVariables);
}

public static MessagingV1Message fromJson(String jsonString, ObjectMapper mapper) throws IOException {
return mapper.readValue(jsonString, MessagingV1Message.class);
Expand Down

0 comments on commit b809201

Please sign in to comment.