eclipse-ee4j / eclipse-ee4j/jersey
Client readEntity for a parametericType
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
In plain Jackson Deserialization, we can deserialize to a parametricType as in below:
```
ObjectType objectType = new ObjectType();
Class ObjectTypeClass = objectType.getClass();
ObjectMapper mapper = new ObjectMapper();
TypeFactory typeFactory = mapper.getTypeFactory();
MyClass object = mapper.readValue(jsonStr,typeFactory.constructParametricType(MyClass.class, objectTypeClass));
```
This will result in a variable "object" of Type "MyClass"
If I tried to the same using readEntity Method, the only way to do something similar is using GenericType as below:
```
MyClass object = myresp.readEntity(new GenericType>() {
});
```
But the end result is "object" of Type "MyClass"
Is there a way to mimic what I can do using the normal mapper.readVallue in Jackson with JavaType in Jersey Client response.readEntity?
Contributor guide
Assessment
This issue has not been assessed yet.