Skip to content

Commit a3585dd

Browse files
authored
Merge pull request eugenp#3471 from eugenp/BAEL-1177
remove gson
2 parents 7bd1fbf + f2a097b commit a3585dd

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

‎spring-cloud/spring-cloud-security/personresource/pom.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
<groupId>org.springframework.security</groupId>
4444
<artifactId>spring-security-jwt</artifactId>
4545
</dependency>
46-
<dependency>
47-
<groupId>com.google.code.gson</groupId>
48-
<artifactId>gson</artifactId>
49-
</dependency>
5046
</dependencies>
5147

5248
<dependencyManagement>

‎spring-cloud/spring-cloud-security/personresource/src/main/java/com/baeldung/controller/PersonInfoController.java‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
import org.springframework.web.bind.annotation.RestController;
77

88
import com.baeldung.model.Person;
9-
import com.google.gson.Gson;
109

1110
@RestController
1211
public class PersonInfoController {
1312

1413
@GetMapping("/personResource")
1514
@PreAuthorize("hasAnyRole('ADMIN', 'USER')")
16-
public @ResponseBody String personInfo() {
17-
Gson gson = new Gson();
18-
String person = gson.toJson(new Person("abir", "Dhaka", "Bangladesh", 29, "Male"));
19-
return person;
15+
public @ResponseBody Person personInfo() {
16+
return new Person("abir", "Dhaka", "Bangladesh", 29, "Male");
2017
}
2118
}

0 commit comments

Comments
 (0)