Is there an authoritative position I can cite when it comes to a trailing slash on a Restful URI? One from Roy Fielding would be great. The web has authoritative opinions both ways. The two positions are: The trailing slash indicates a resource and not having does not. The other argument is that the trailing slash has no semantic value. Which is it? Example:
@GetMapping(path = "/users/")
public List<User> getUsers() {
....
}
@GetMapping(path = "/users/{id}")
public User getUser(@PathVariable String type) {
.....
}
@PutMapping(path = "/users/")
public User updateUser(@RequestBody User user) {
....
}
@PostMapping(path = "/users/")
public User createUser(@RequestBody User user) {
....
}
@DeleteMapping(path = "/users/{id}")
public void deleteUser(@PathVariable Long id) {
....
}
Should the trailing slash be removed?