Expected Behavior
A default constructor of CloudEvent is helpful for unmarshalling the payload to the exact type automatically in a Spring MVC application, for example:
@RestController
public class MqBindingController {
@Autowired
@Qualifier("jsonDaprClient")
private DaprClient daprClient;
@GetMapping("/dapr/subscribe")
public Flux<Subscription> subscribe() {
Subscription[] subscriptions = new Subscription[]{
new Subscription("pubsub", "BEIWEI_TEST_TOPIC_A", "A"),
new Subscription("pubsub", "BEIWEI_TEST_TOPIC_B", "B"),
};
return Flux.fromArray(subscriptions);
}
@PostMapping("/A")
public ResponseEntity<HttpStatus> topicA(@RequestBody byte[] payload) {
...
}
@PostMapping("/B")
public ResponseEntity<HttpStatus> topicB(@RequestBody CloudEvent payload) { // this doesn't work
...
}
...
}
Spring complains no default constructor is present for CloudEvent.
Actual Behavior
@PostMapping("/B")
public ResponseEntity<HttpStatus> topicB(@RequestBody CloudEvent payload) {
}
I believe this applies to all classes under io.dapr.client.domain.
Steps to Reproduce the Problem
Release Note
RELEASE NOTE: REFACTORED CloudEvent serialization, also adding default constructor.
Expected Behavior
A default constructor of CloudEvent is helpful for unmarshalling the payload to the exact type automatically in a Spring MVC application, for example:
Spring complains no default constructor is present for CloudEvent.
Actual Behavior
I believe this applies to all classes under io.dapr.client.domain.
Steps to Reproduce the Problem
Release Note
RELEASE NOTE: REFACTORED CloudEvent serialization, also adding default constructor.