Sri Lakshmi Kanthan P created WW-5651:
-----------------------------------------
Summary: Support Java record serialization and Optional handling
in Struts JSON plugin
Key: WW-5651
URL: https://issues.apache.org/jira/browse/WW-5651
Project: Struts 2
Issue Type: Improvement
Reporter: Sri Lakshmi Kanthan P
This change updates the Struts JSON plugin to properly handle Java record
classes and java.util.Optional values.
Record classes are now serialized through record components, since
Introspector.getBeanInfo() does not expose record accessors as standard
JavaBeans properties. This also allows annotations such as @JSON and
@JSONFieldBridge to be placed directly on record components.
Optional values now serialize as the contained value, or null when empty.
Optional.empty() is treated the same as null when excludeNullProperties is
enabled, for both bean/record properties and map values.
Please review the implementation and the overall approach. If there are any
improvements or changes needed, I am happy to update the PR.
GitHub Pull Request:
https://github.com/apache/struts/pull/1792
--
This message was sent by Atlassian Jira
(v8.20.10#820010)