Closed piotrekfus91 closed 3 years ago
Hi, I have a simple mapping to do (target class is generated from jsonschema, but in another maven module):
public record Codec(String codecString, String privateData) { public Codec { notBlank(codecString); notBlank(privateData); } }
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "codecString", "privateData" }) public class CodecJson { /** * * (Required) * */ @JsonProperty("codecString") @NotNull private String codecString; /** * * (Required) * */ @JsonProperty("privateData") @NotNull private String privateData; @JsonIgnore @Valid private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * * (Required) * */ @JsonProperty("codecString") public String getCodecString() { return codecString; } /** * * (Required) * */ @JsonProperty("codecString") public void setCodecString(String codecString) { this.codecString = codecString; } public CodecJson withCodecString(String codecString) { this.codecString = codecString; return this; } // remaining getters/setters are similar
When I make such mapping:
@Mapper(componentModel = "spring") public interface PackagerParametersMapper { InitSegmentParametersJson map(InitSegmentParameters initSegmentParameters); CodecJson map(Codec codec);
I get:
@Override public CodecJson map(Codec codec) { if ( codec == null ) { return null; } CodecJson codecJson = new CodecJson(); return codecJson; }
Expected behavior is to add both field values to returning codecJson. Am I correct? Mapstruct 1.4.2.
codecJson
Hi, I have a simple mapping to do (target class is generated from jsonschema, but in another maven module):
When I make such mapping:
I get:
Expected behavior is to add both field values to returning
codecJson
. Am I correct? Mapstruct 1.4.2.