FasterXML / FasterXML/jackson-databind
Exception while deserializing with `@JsonRootName` when multiple root properties
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.5k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 28
Description
Desirialization does not work when there are multiple nodes available at same level as value provided in the JsonRootName
Note:
Wrapper is configured with following:
```
objectMapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
```
Class:
```
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonRootName(value = "response")
public class UserProfile {
String name;
String link;
}
```
Input JSON (which works):
```
{
"response": {
"name": "User one:",
"link": "Some Link"
}
}
```
Input JSON (which does not work)
```
{
"response": {
"name": "User one:",
"link": "Some Link"
},
"apiVersion" : 1.0
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.