Skip to content

@JsonPacked Annotation

For engines that don’t support list property values (Neptune), annotate collection fields to transparently serialize as JSON strings:

@RelationshipFragment
data class WorkHistory(
val role: String,
@JsonPacked val tags: List<String>? = null,
val target: Organization
)

On write: ["backend", "senior"] is stored as the string '["backend","senior"]'. On read: the JSON string is deserialized back to List<String>. Works across all engines.