ObjectMapper
Learn ObjectMapper (REST API with Spring MVC, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes ObjectMapper is the central Jackson class: writeValueAsString converts an object to JSON and readValue converts JSON to an object. Thread safe once configured, so share one instance instead of creating a new one per call. In Spring Boot you simply inject the auto-configured bean with @Autowired or constructor injection.
More lessons in REST API with Spring MVC
- REST Architecture
- RESTful API Design
- REST Controller
- @RestController
- JSON Request
- JSON Response
- Jackson
- JSON Serialization
- JSON Deserialization
- HttpMessageConverter
- MappingJackson2HttpMessageConverter
- ResponseEntity
- HTTP Status Codes
- API Versioning
- REST API Best Practices
- Mini Project: REST Details: PUT vs PATCH, Pagination, ETag and Allowed Methods