I'm writing REST APIs using Swagger api. Now, I want to write methods for insert, update and delete in following way (I've seen such paths on many APIs online):
- POST (for insert)
/students
- PUT (for update)
/students/{studentId}
- DELETE (for delete)
/students/{studentId}
Now, 1 is okay, but 2 and 3 are same paths (but have different methods). Swagger API gives me error when I write so. So is this really not allowed?
If it's not allowed, what are some best ways to define different paths without making them long and still look 'cool'?