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).