Closed l-wegner closed 3 years ago
I managed to work around that by introducing a POJO GistListEntries instead of List
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Introspected
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
public class GistListEntries {
@Singular
@Valid
@NotNull
@ValidAttributeGroup
List<GistListEntry> members;
}
You should remove @JsonTypeInfo(use= JsonTypeInfo.Id.CLASS)
from the GistListEntry
then it works with the latest version
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
Steps to Reproduce
Expected Behaviour
Both tests pass.
Actual Behaviour
The test unmarshalling the entity from the database fails, because jackson does not know, which type is in the list.
Serialization is handled by the jsonCodec, which delegates eventually to jackson AbstractSqlRepositoryOperations#setStatementParameter. Deserialization via jsonCodec is not applied and the readProperty returns a plain string ( SqlResultEntityTypeMapper#readEntity).
Environment Information
Example Application