Open alexp1917 opened 3 years ago
@alexp1917 I created a barebones project using Spring Boot + Spring Data Cassandra + Spring Data REST. I can switch spring.data.rest.detection-strategy=annotated
on and off, and it works as expected.
I could NOT replicate that NullPointerException
.
You can inspect my sample project => spring.data.rest.detection-strategy=annotated
Hopefully, this sample project provides something to compare against your own code and identify a difference.
I'll aim to put together an example by the end of thanksgiving weekend. thanks for looking into this. i am reading my ticket now and realizing its a bit too open ended.
"mapping" can be null here, causing the
.isExported()
to throw a NPE.https://github.com/spring-projects/spring-data-rest/blob/a40aec5debf496b8e29d66a720ad27989b04f2bd/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileController.java#L94-L111
I thought i was using the strategy to only include annotated repositories and that would not happen (
spring.data.rest.detection-strategy=annotated
). I did not intend for this repository to actually be included in the profile. but it got to this point in the code and it null pointer'ed.