要具体回答您的问题,您可以使用@Field("line1")
for street
in Address
。
我的项目中有类似的东西,它工作正常(请参阅descriptions
)
1级
@Document
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HotelInfo {
@Field("hotel_type") @JsonProperty("hotel_type")
public String hotelType;
@Field @JsonProperty("images")
public List<Image> images = new ArrayList<Image>();
@Field @JsonProperty("regions")
public List<String> regions = new ArrayList<String>();
@Field @JsonProperty("themes")
public List<String> themes = new ArrayList<String>();
@Field @JsonProperty("facilities")
public List<String> facilities;
@Field @JsonProperty("descriptions")
public Descriptions descriptions;
}
2 级
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Descriptions {
@Field("hotel_information") @JsonProperty("hotel_information")
public String hotelInformation;
}