I have the following java code/Object:
@Entity
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class Company implements java.io.Serializable {
...
@XmlElementWrapper(name="trips")
@XmlElement(name = "trip")
private Set<Trip> trips = new HashSet<Trip>(0);
...
}
Here are the relevant jars files:
The response is json in the console:
"trips":{"trip":{"id":1,"name":"ABC"}}}}
As you can see the response doesn't include any brackets ("[]") which means the resteasy doesn't convert it to array, This behaviour causes me a lot of issue in the angular app. Is there a way to force the java/resteasy to convert to array so I can easily manipulate the array in the Angular app ?
What is the best practice to transform list to an Angular app ? I believe that the json should be something like:
"trips":{[{"id":1,"name":"ABC"},{"id":2,"name":"XYZ"}]}
Thanks in advance.