Spring Boot - Error handling multi values in "RequestMaping"
xiujunma opened this issue · 2 comments
xiujunma commented
@RestController
@RequestMapping("/user")
class UserController(
@Autowired val userRepository: UserRepository
) {
@GetMapping(value =["/", ""]) // <- Not able to handle this.
fun all():Iterable<User> {
return userRepository.findAll()
}
}
Execution failed for task ':generate'.
List has more than one element.
Deleted user commented
This message seems to be caused by the call to currentPath.single()
in https://github.com/JetBrains/kotless/blob/master/dsl/spring/spring-lang-parser/src/main/kotlin/io/kotless/parser/spring/processor/route/SpringAnnotationUtils.kt#L48.
Note that there is an explicit check for methods annotated with RequestMapping
at line 54.
TanVD commented
Yep, thanks!