انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-011-L08

عرض عملي: تجاوز الإعداد التلقائي لـ Jackson

  • الدرس 8 من 8
  • Junior
في هذا الدرس 3 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

change JSON date output in two ways.

تفاصيل المخطط المبدئي

خطوة بخطوة

  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.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.