I created a small spring boot project to retrieve a sample object from mongoDb via spring data rest which contains a Seq (vavr collection). Immediately after booting the app it doesn't work. At first I have to do an insertion and afterwards it works to call teh repo's rest endpoint.
Error msg from log
Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Couldn't find PersistentEntity for type class io.vavr.collection.List$Cons!; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Couldn't find PersistentEntity for type class io.vavr.collection.List$Cons! (through reference chain: org.springframework.hateoas.PagedResources["_embedded"]->java.util.Collections$UnmodifiableMap["myEntities"]->java.util.ArrayList[0]->org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$PersistentEntityResourceSerializer$1["content"]->de.spring.demo.entity.MyEntity["myList"])
It sounds like some mappers have to be injected which are automatically injected after inserting a new entry (or some lazy loading maybe...)
A sample can be found here: https://github.com/renne-b/spring-rest-demo
It would be great to get a hint what's missing.
some details:
- latest spring boot milestone: 2.0.0.M3
- I registered VavrModule at ObjectMapper
- @EnableMongoRepositories(basePackages = "for my path to classes")