Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Json deserialization throws "unknown property" exception due to usage of wrong Jax-rs Provider
Description
It is currently not possible to use the BusinessServiceRestService ("/business-services") REST API with Json.
Somehow the Rest implementation uses the JacksonJsonProvider instead of the JaxbJacksonJsonProvider. This means that all JAXB annotations (e.g. @XmlElement) are not interpreted correctly and an Excepetion is thrown while deserializing a Java Object to Json (due to missing @JsonProperty annotations).
For now I disabled tests which try to serialize/deserialize Json objects (via Rest). Be aware that serialize/deserialize in the unmarshal tests (e.g. IpServiceResponseDTOMarshalTest) works just fine.
To reproduce this issue navigate to the class BusinessServiceRestServiceIT and uncomment the lines which send Json formatted data to the Rest Service Implementation, e.g.
It is currently not possible to use the BusinessServiceRestService ("/business-services") REST API with Json.
Somehow the Rest implementation uses the JacksonJsonProvider instead of the JaxbJacksonJsonProvider. This means that all JAXB annotations (e.g. @XmlElement) are not interpreted correctly and an Excepetion is thrown while deserializing a Java Object to Json (due to missing @JsonProperty annotations).
For now I disabled tests which try to serialize/deserialize Json objects (via Rest). Be aware that serialize/deserialize in the unmarshal tests (e.g. IpServiceResponseDTOMarshalTest) works just fine.
To reproduce this issue navigate to the class BusinessServiceRestServiceIT and uncomment the lines which send Json formatted data to the Rest Service Implementation, e.g.
sendData(POST, MediaType.APPLICATION_JSON, "/business-services", toJson(toRequestDto(bs)), 201);
Both Xml and Json should work.