You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2026/07/20 07:32:00 UTC

[jira] [Resolved] (WW-5652) Support Java record serialization and Optional handling in Struts JSON plugin

     [ https://issues.apache.org/jira/browse/WW-5652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-5652.
-------------------------------
    Resolution: Fixed

> Support Java record serialization and Optional handling in Struts JSON plugin
> -----------------------------------------------------------------------------
>
>                 Key: WW-5652
>                 URL: https://issues.apache.org/jira/browse/WW-5652
>             Project: Struts 2
>          Issue Type: Improvement
>            Reporter: Sri Lakshmi Kanthan P
>            Priority: Major
>             Fix For: 7.3.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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)