Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: De-serialization error spring boot reactive

Tags: flux error spring

royB:

I have a simple controller


@RestController
@RequestMapping("path")
public class MyController {

@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public Flux run(@RequestBody Flux request){

//do something and return flux
}
...
}

On calling this url I'm getting the exception


"Type definition error: [simple type, class reactor.core.publisher.Flux]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Can not construct instance of reactor.core.publisher.Flux (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information\n at [Source: (PushbackInputStream); line: 1, column: 1]

I understand this Error and usually, I would just add an annotation if needed

@JsonDeserialize(as = SomeConcreteClass.class)

But in this case, to which Flux concrete example should I bind? Also, Doesn't Spring boot has a default auto-deserializers for Reactor Types (Mono, Flux)?

My pom (relevant stuff):



org.springframework.boot
spring-boot-starter-web


org.springframework.boot
spring-boot-starter-webflux


org.springframework.data
spring-data-commons




Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: De-serialization error spring boot reactive

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×