I have the following controller in my Spring Boot application :
@RestController
@RequestMapping(value = "/users")
public class UserController {
@Autowired
UserService userService;
@GetMapping(value ="/helloWorld")
public String getHelloWorld() {
return "Hello World!";
}
@GetMapping(value = "/getAll")
public @ResponseBody
Iterable<User> getAllInvestors() {
return userService.getAllUsers();
}
}
When I make an HTTP Get on http://127.0.0.1:5000/users/getAll
, it works perfectly : I get all the users from the database...
but when I make a call on http://127.0.0.1:5000/users/helloWorld
, I get an unexpected error (type=Not Found, status=404)
- PS 1 : When I call
http://127.0.0.1:5000/api-docs
to get the API definition : Both endpoints are exposed. - PS 2 : I've already made a Maven Clean, restarted IntelliJ, deleted all cookies from the browser.
- PS 3 : No errors during compilation.