diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/webflux/MyRestController.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/webflux/MyRestController.java index bde6ad0451e5..338c9e9a612c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/webflux/MyRestController.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/webflux/MyRestController.java @@ -38,19 +38,19 @@ public MyRestController(UserRepository userRepository, CustomerRepository custom this.customerRepository = customerRepository; } - @GetMapping("/{user}") + @GetMapping("/{userId}") public Mono getUser(@PathVariable Long userId) { return this.userRepository.findById(userId); } - @GetMapping("/{user}/customers") + @GetMapping("/{userId}/customers") public Flux getUserCustomers(@PathVariable Long userId) { return this.userRepository.findById(userId).flatMapMany(this.customerRepository::findByUser); } - @DeleteMapping("/{user}") - public void deleteUser(@PathVariable Long userId) { - this.userRepository.deleteById(userId); + @DeleteMapping("/{userId}") + public Mono deleteUser(@PathVariable Long userId) { + return this.userRepository.deleteById(userId); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/MyRestController.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/MyRestController.java index 461c67fbe284..894fa6605ca0 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/MyRestController.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/MyRestController.java @@ -37,17 +37,17 @@ public MyRestController(UserRepository userRepository, CustomerRepository custom this.customerRepository = customerRepository; } - @GetMapping("/{user}") + @GetMapping("/{userId}") public User getUser(@PathVariable Long userId) { return this.userRepository.findById(userId).get(); } - @GetMapping("/{user}/customers") + @GetMapping("/{userId}/customers") public List getUserCustomers(@PathVariable Long userId) { return this.userRepository.findById(userId).map(this.customerRepository::findByUser).get(); } - @DeleteMapping("/{user}") + @DeleteMapping("/{userId}") public void deleteUser(@PathVariable Long userId) { this.userRepository.deleteById(userId); }