Iterable printing name of the java object and not the value of the object

时间:2016-10-20 19:33:18

标签: java web-services rest spring-boot jaxb

I have an API, In my model objects one of the property has Iterable as return type-

basically I am converting v6 objects to v8 objects.

    @XmlElement(name = "showTimeDetails")
    @ApiModelProperty(value = "Some text")
    Iterable<ShowAvailabilityDetail> getShowAvailabilityDetails();

and when I am setting the value of setShowAvailabilityDetails(List<Object>); -

List<ShowAvailabilityDetail> fadV6 = showAccountTransactionV6
                    .getShowAvailabilityDetails();

showAccountTransactionV8.setShowAvailabilityDetails(fadV6)

as a List type and print this value in json, it prints the internal object name -

"showTimeDetails":someobjectname.java.com.somethinng.321312343242498

since all collections implement Iterable, I am not sure why it would not print the values.

and when I changed the property return type to List it has print the real values-

 @XmlElement(name = "showTimeDetails")
 @ApiModelProperty(value = "Some text")
 List<ShowAvailabilityDetail> getShowAvailabilityDetails();

Please help me understand why it would not behave the same with return type Iterable as List implements Iterable.

0 个答案:

没有答案