Description
Using Spring Boot Data 3.0.6, with Kotlin.
I have a UserRepository
extending a CrudRepository
, with a method override
@RestResource
override fun findById(id: Long): Optional<User>
My default method exposure is disabled.
When I call my REST endpoint on /users/123
I get a 405 Method Not Allowed. If I enable method exposure, the default implementation from CrudRepository
is being picked up instead of my custom declared repository method.
If I declare a custom findAll()
, this gets picked up without issues.
I did some digging and it seems that in DefaultCrudMethods.selectMostSuitableFindOneMethod(...)
it fails to find the custom interface method, it however does find the CrudRepository one. It calls ReflectionUtils.findMethod(UserRepository.class, "findById", Long.class)
, and there the comparison of parameter types somehow fails.