私はJackson 2.1.0を使用しています。与えられた:入力リストがhttp://test.com/
が含まれている場合リストの@JsonUnwrappedが動作しないのはなぜですか?
public static final class GetCompanies
{
private final List<URI> companies;
/**
* Creates a new GetCompanies.
* <p/>
* @param companies the list of available companies
* @throws NullPointerException if companies is null
*/
@JsonCreator
public GetCompanies(@JsonUnwrapped @NotNull List<URI> companies)
{
Preconditions.checkNotNull(companies, "companies");
this.companies = ImmutableList.copyOf(companies);
}
/**
* @return the list of available companies
*/
@JsonUnwrapped
@SuppressWarnings("ReturnOfCollectionOrArrayField")
public List<URI> getCompanies()
{
return companies;
}
}
、ジャクソンは生成します。
{"companies":["http://test.com/"]}
の代わり:
["http://test.com/"]
任意のアイデア?
更新:関連する説明はhttps://github.com/FasterXML/jackson-core/issues/41を参照してください。この場合