Skip to content
Ameen Abozaid
Planned lessonJNR-011-L08

Demo: overriding Jackson's auto-configuration

  • Lesson 8 of 8
  • Junior
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

change JSON date output in two ways.

Draft outline details

Step by step

  1. Call an endpoint returning a date and observe the format (the default depends on version; verify version before recording).
  2. Set a property such as spring.jackson.serialization.write-dates-as-timestamps=false; observe.
  3. Define a Jackson2ObjectMapperBuilderCustomizer bean (or the customizer for the current Jackson line) to set a format.
  4. Planned mistake: define a whole new ObjectMapper bean and lose Boot's module registration and settings. Fix: prefer the property or customizer; define your own mapper only when you need full control.
  5. Check the conditions report: the default mapper bean is skipped when you define your own.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.