I'm currently building a rest controller with spring boot for user management.
I have a update user endpoint which receives a json file with the updated user data.
Now the problem is that there are different types of users which inherit from a base user... students and supervisors.
If I want to update a student, the json file has a "degree" values which a supervisor doesn't have.
So the following approach doesn't work because degree is not mapped to anything.
@PutMapping(value = "/users/current")
public void updateUser(@RequestBody User user)
Is there an approach to solve this without using two different routes for students and supervisors? It would need some kind of overloading...