Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding path variable names to avoid Spring Boot 3.x migration issues #1062

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public void postMessages(@RequestBody String message){
}

@PutMapping(path = "/messages/{messageId}")
public void putMessages(@PathVariable Integer messageId, @RequestBody String message){
public void putMessages(@PathVariable("messageId") Integer messageId, @RequestBody String message){
messagesReceived.put(messageId,message);
}

@DeleteMapping(path = "/messages/{messageId}")
public void deleteMessages(@PathVariable Integer messageId){
public void deleteMessages(@PathVariable("messageId") Integer messageId){
messagesReceived.remove(messageId);
}

Expand All @@ -58,7 +58,7 @@ public void postPerson(@RequestBody Person person){
}

@PutMapping(path = "/persons/{personId}")
public void putPerson(@PathVariable Integer personId, @RequestBody Person person){
public void putPerson(@PathVariable("personId") Integer personId, @RequestBody Person person){
final Optional<Person> auxPerson = persons.stream().filter(person1 -> person1.getId() == personId).findFirst();
if(auxPerson.isPresent()){
auxPerson.get().setName(person.getName());
Expand All @@ -68,7 +68,7 @@ public void putPerson(@PathVariable Integer personId, @RequestBody Person person
}

@DeleteMapping(path = "/persons/{personId}")
public void deletePerson(@PathVariable Integer personId){
public void deletePerson(@PathVariable("personId") Integer personId){
final Optional<Person> auxPerson = persons.stream().filter(person1 -> person1.getId() == personId).findFirst();
if(auxPerson.isPresent()) {
persons.remove(auxPerson.get());
Expand Down
Loading