eclipse-ee4j / eclipse-ee4j/jersey

MOXyJsonProvider cannot unmarshall JSON arrays into custom collection types

Open
#3,097 4 comments 0 reactions 0 assignees View on GitHub
Component: media Priority: Major Type: Bug
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Note: This is a problem in MOXy 2.6\. It's filed against Jersey just to track the progress and the issue should be closed when new MOXy is integrated into Jersey.

Consider you have this JSON:

```
[{"jaxbBean":{"value":"one"}},{"jaxbBean":{"value":"two"}},{"jaxbBean":{"value":"three"}}]
```

Resource Method like:

```
@POST
@Path("custom")
public MyArrayList postCustom(final MyArrayList l) {
return l;
}
```

Where MyArrayList looks like:

```
public class MyArrayList extends ArrayList {

public MyArrayList() {
}

public MyArrayList(final Collection a) {
super(a);
}

}
```

The JSON is unmarshalled as list of lists (MyArrayList of MyArrayLists) but JaxbBeans are not in unmarshalled object.
#### Affected Versions
[2.18]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.