Skip to content

Commit

Permalink
Adding path variable names to avoid Spring Boot 3.x issues
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
  • Loading branch information
Artur Ciocanu committed Jun 27, 2024
1 parent 64f291f commit 2bc0715
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 2bc0715

Please sign in to comment.