com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Невозможно определить свойство Creator "child" как `@JsonUnwrapped - PullRequest
0 голосов
/ 10 мая 2019

Ниже код работал нормально с jackson-databind и jackson-core 2.8.5, но перестал работать с 2.9.5.Я должен использовать 2.9.5.

@JsonCreator
public InstrumentCombinedJson(
        @JsonProperty("referenceList") final List<InstrumentReferenceJson> referenceList,
        @JsonProperty("timeseriesList") final List<InstrumentTimeSeriesJson> timeseriesList,
        @JsonProperty("_links") final Map<String, String> _links) {
    super(_links);
    this.referenceList = referenceList;
    this.timeseriesList = timeseriesList;
}

@JsonUnwrapped
public List<InstrumentReferenceJson> getReferenceList() {
    return referenceList;
}

@JsonUnwrapped
public List<InstrumentTimeSeriesJson> getTimeseriesList() {
    return timeseriesList;
}

Выдает ниже сообщение об ошибке:

 com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot define Creator property "referenceList" as `@JsonUnwrapped`: combination not yet supported
 at [Source: (StringReader); line: 1, column: 1]

    at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
    at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1451)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase._findPropertyUnwrapper(BeanDeserializerBase.java:829)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:494)

Проблема уже открыта на github: https://github.com/FasterXML/jackson-module-kotlin/issues/106

Может ли кто-нибудь помочь мне с любым обходным путем, чтобы заставить его работать?

...