Miragon / miranum

Engine neutral framework to build integrations. Simplifying the complexity process automation comes with.
https://miranum.io
MIT License
16 stars 3 forks source link

Miranum Worker mapping can not map json-string to object #360

Closed DaAnda97 closed 1 month ago

DaAnda97 commented 1 month ago

On a simple example I'm implementing a c7 bpmn process with two service tasks. The first one writes an object to the engine, the second one reads it. While reading I get the following exception:

java.lang.IllegalArgumentException: Cannot construct instance of `io.test.ExampleObject` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value () at [Source: UNKNOWN; byte offset: #UNKNOWN]

My ExampleObject looks like this:


@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ExampleObject {

    private List<ExampleInner> inner;
}

---
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ExampleInner {

    private String value;
}

I was able to break the issue down to Jackson Object mapper, which uses mapper.convertValue(jsonString, ExampleObject.class). Replacing it with mapper.readValue(jsonString, ExampleObject.class) worked without issues. Please fix that!

dominikhorn93 commented 1 month ago

sounds like a valid solution to me.