Grokking Spring Boot
0% completed
Overriding Auto-Configuration
We started the booking service twice with the same setting, --spring.jackson.property-naming-strategy=SNAKE_CASE, which asks for JSON field names with underscores. Then we called GET /bookings/1 in each run. The first run returned what the setting asked for.
{"id":1,"event_id":7,"seat_label":"A12","status":"CONFIRMED"}
The second run ignored the setting.
{"id":1,"eventId":7,"seatLabel":"A12","status":"CONFIRMED"}
The only difference between the two runs was one bean. In the second run, the service defined its own JsonMapper
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%