dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
848 stars 466 forks source link

Integrate Jackson Optional Mapper in ObjectMapper for Handling Optional Fields #29041

Open josemejias11 opened 2 months ago

josemejias11 commented 2 months ago

Parent Issue

#

Problem Statement

Enhance the existing ObjectMapper code by integrating Jackson’s Optional Mapper to handle fields that may or may not be present in the JSON data.

Steps to Reproduce

  1. Create a content type with a WYSIWYG
  2. Add some html to the WYSIWYG
  3. Convert the WYSIWYG to a block field
  4. See the error in the log

https://gist.github.com/josemejias11/6fc25dfc713503d94addb1b673b75a01

Acceptance Criteria

The ObjectMapper should correctly handle JSON objects with optional fields, mapping them to Optional types in the application code.

dotCMS Version

24.06.26

Proposed Objective

Core Features

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

Screenshot 2024-06-27 at 11 34 44 AM

Sub-Tasks & Estimates

No response

erickgonzalez commented 1 day ago

I think this is already fixed at https://github.com/dotCMS/core/pull/29927, but let's double-check.