JSON serialization issue with web services

9 views
Skip to first unread message

Adrian Tenney

unread,
Oct 27, 2025, 5:54:41 PM (9 days ago) Oct 27
to jackson-user
Hi,
We have code that was running well with 2.9.7.  Due to CVEs, we updated to the latest and an issue appeared.  Iterating through the versions, it works in 2.15.4 but not starting in 2.16.0-rc1.  Below is an example of the problem:

@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/asjson/")
public TubeSystem getConfigJSON() {
TubeSystem ts = sysModel.getTubeSystem();
return ts;
}

TubeSystem is a complex jaxb object containing many items.  In 2.15.4 enum values passed back to the caller use the "value" property, however in later versions the "name" property is returned.

Runtime object properties:
model=StationModel
  > name="DM_1010"    (<-- returned in 2.16.0-rc1 and above)
  > ordinal=0
  > value="DM1010"       (<-- returned in 2.15.4 and below- expected)

xsd definition of enum:
<xs:simpleType name="StationModel">
<xs:restriction base="xs:string">
<xs:enumeration value="DM1010" />
<xs:enumeration value="TS4700" />
<xs:enumeration value="TS4900" />
</xs:restriction>

Note, the only change is to the pom:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.16.0-rc1</version>       (works with 2.15.4)
</dependency>

Am I making a mistake?  Also, if the function is changed to:
@GET
@Produces(MediaType.APPLICATION_XML)
@Path("/asjson/")
public TubeSystem getConfigJSON() {
TubeSystem ts = sysModel.getTubeSystem();
return ts;
}
the result is correct (returns the value, not the name).

Joo Hyuk Kim

unread,
Oct 27, 2025, 8:52:19 PM (8 days ago) Oct 27
to jackso...@googlegroups.com
1. Please provide reproduction only using Jackson and Java. Its diffcult to pinpoint problems behind ur webframework. Also besure to include your POJO, simplified version.

2. I suggest report thru Github discussion, u will get more response.


2025년 10월 28일 (화) 오전 6:54, 'Adrian Tenney' via jackson-user <jackso...@googlegroups.com>님이 작성:
--
You received this message because you are subscribed to the Google Groups "jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jackson-user/b892a98d-ef41-47dc-b922-72c1eec65e7dn%40googlegroups.com.

Adrian Tenney

unread,
Oct 30, 2025, 1:23:16 PM (6 days ago) Oct 30
to jackson-user
OK, thank you!
Reply all
Reply to author
Forward
0 new messages