jackson-kotlin-serialization-specialist
Skill18 starsChanged 9 months agoMITView on GitHub
Diagnose and design JSON serialization and deserialization behavior for Kotlin plus Jackson in Spring applications. Use when DTOs fail to deserialize, default parameters or nullability behave unexpectedly, date-time or enum formats drift, polymorphic payloads are involved, PATCH semantics must distinguish null from absent, or ObjectMapper changes risk breaking existing API or message contracts.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- JetBrains/skillsedited, first seen Apr 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- JetBrains/skills★ 36096% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- ci-cd-containerization-advisorSkill
- configuration-properties-profiles-kotlin-safeSkill
- dependency-conflict-resolverSkill
- domain-decomposition-api-design-advisorSkill
- error-model-validation-architectSkill
- gradle-kotlin-dsl-doctorSkill
- integration-resilience-engineerSkill
- java-kotlin-migration-assistantSkill
- jpa-spring-data-kotlin-mapperSkill
- kotlin-idiomatic-refactorer-spring-awareSkill
- kotlin-spring-proxy-compatibilitySkill
- observability-integratorSkill
- performance-concurrency-advisorSkill
- production-incident-responderSkill
- project-context-ingestionSkill
- schema-migration-plannerSkill
- spring-context-di-reasoningSkill
- spring-kotlin-code-reviewSkill
- spring-mvc-webflux-api-builderSkill
- spring-security-configurator-auditorSkill
- stacktrace-log-triageSkill
- test-suite-builderSkill
- transaction-consistency-designerSkill
- upgrade-breaking-change-navigatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 21 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Treat wire-format correctness as a contract problem, not only a mapper-configuration problem.
- Distinctive: line 25
Verify module presence and alignment:
- Distinctive: line 33
Verify field presence semantics:
- Distinctive: line 37
Verify naming, inclusion, and date-time strategy.
- Distinctive: line 38
Verify polymorphism or custom serializer behavior.
- Distinctive: line 39
Verify whether the real bug comes from a local mapper override rather than the global mapper.
- Distinctive: line 43
Keep DTOs immutable unless the project already has a strong alternative convention.
- Very specific: line 44
Do not switch val to var just to appease Jackson.
- Distinctive: line 45
Do not add empty constructors to Kotlin DTOs as a workaround if the Kotlin module can model the contract correctly.
- Distinctive: line 46
Treat nullable as a wire-contract decision, not a convenient escape hatch.
- Distinctive: line 52
Default constructor values can silently hide client mistakes if the field should have been required.
- Distinctive: line 67
If the API is documented through OpenAPI or consumer contracts, make sure the documented nullability and actual wire behavior match.
- Distinctive: line 71
If the same model is used on both inbound and outbound boundaries, check whether the optimal serializer settings are actually symmetrical.
- Distinctive: line 72
If clients rely on partial update semantics, prefer an explicit patch model rather than trying to infer intent from ordinary DTO …
- Distinctive: line 73
If a serializer bug appears after a dependency upgrade, inspect feature defaults and module registration order before rewriting DTOs.
- Distinctive: line 74
If compatibility matters, prove the fix with golden JSON examples or snapshot-style serialization tests, not only with one happy-path …
- Distinctive: line 79
Keep transport DTOs separate from persistence and domain objects when contract stability matters.
- Distinctive: line 80
If payload evolution matters, favor additive fields and backward-compatible defaults over silent semantic changes.
- Distinctive: line 81
If multiple serialization contexts exist, decide which behavior is global and which is boundary-specific.
- Distinctive: line 96
Do not recommend random Jackson versions outside the repository's version authority.
- Distinctive: line 97
Do not add global mapper behavior for a local one-off issue without explaining blast radius.
- Very specific: line 98
Do not hide a contract problem behind broad JsonNode or Map<String, Any> usage unless the boundary is intentionally untyped.
- Distinctive: line 99
Do not rely on Jackson defaults when a stable external contract matters.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Jackson Kotlin Serialization Specialist
Source mapping: Tier 2 high-value skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-08).
Mission
Make Kotlin plus Jackson behavior explicit, compatible, and testable. Treat wire-format correctness as a contract problem, not only a mapper-configuration problem.
Read First
- The actual DTO or event model classes.
- The exact failing JSON payload or expected payload examples.
ObjectMappercustomizers, Spring Boot Jackson properties, and any per-client mapper overrides.- Build files to verify Jackson module alignment with Spring Boot and Kotlin versions.
- The boundary where serialization matters: MVC, WebFlux, Kafka, Redis, persistence JSON column, or external HTTP client.
Diagnose In This Order
- Verify module presence and alignment:
jackson-module-kotlinJavaTimeModule- other custom modules or serializers
- Verify constructor semantics:
- default parameters
- required parameters
- nullable versus non-null
- Verify field presence semantics:
- absent
- present with
null - present with value
- Verify naming, inclusion, and date-time strategy.
- Verify polymorphism or custom serializer behavior.
- Verify whether the real bug comes from a local mapper override rather than the global mapper.
Core Kotlin Rules
- Keep DTOs immutable unless the project already has a strong alternative convention.
- Do not switch
valtovarjust to appease Jackson. - Do not add empty constructors to Kotlin DTOs as a workaround if the Kotlin module can model the contract correctly.
- Treat nullable as a wire-contract decision, not a convenient escape hatch.
- Be explicit about value classes, sealed hierarchies, and default parameter behavior.
Advanced Serialization Traps
- Missing field and explicit
nullare not the same. For PATCH-like contracts, model tri-state semantics deliberately. - Default constructor values can silently hide client mistakes if the field should have been required.
@JsonIncludemay improve payload size but can also erase signal that clients rely on.- Non-null primitives,
FAIL_ON_NULL_FOR_PRIMITIVES, and Kotlin non-null types interact differently across payload shapes. - Sealed classes need stable, versionable type discriminators. Do not treat polymorphic type ids as an internal detail once they are on the wire.
- Enum serialization by name, code, or custom object form is a public compatibility choice.
- Date-time serialization must make timezone assumptions explicit.
Instant,OffsetDateTime, andLocalDateTimeare not interchangeable. @JvmInline value classsupport may differ by Jackson version and serializer context. Verify scalar form and map-key behavior explicitly.- Global
ObjectMapperchanges can break unrelated endpoints or message consumers. Prefer narrow fixes when the issue is boundary-specific.
Boundary-Specific Nuances
- MVC request and response mapping, Kafka message mapping, Redis payload mapping, and JSON-column mapping often use different mapper lifecycles even inside one codebase.
ObjectMapper.copy()can preserve most configuration while still drifting from future global changes. If a subsystem owns a private mapper, document that divergence.- Kotlin default parameters interact differently with creator annotations, mix-ins, and custom deserializers. If custom deserialization exists, verify constructor invocation explicitly.
- Unknown enum handling, unknown-property handling, and coercion rules are compatibility decisions. A permissive setting may preserve old clients or may quietly accept garbage.
- If the API is documented through OpenAPI or consumer contracts, make sure the documented nullability and actual wire behavior match. Kotlin type hints alone are not enough.
Expert Heuristics
- If the same model is used on both inbound and outbound boundaries, check whether the optimal serializer settings are actually symmetrical. Often they are not.
- If clients rely on partial update semantics, prefer an explicit patch model rather than trying to infer intent from ordinary DTO nullability.
- If a serializer bug appears after a dependency upgrade, inspect feature defaults and module registration order before rewriting DTOs.
- If compatibility matters, prove the fix with golden JSON examples or snapshot-style serialization tests, not only with one happy-path request.
Design Rules
- Choose one naming strategy and document it.
- Keep transport DTOs separate from persistence and domain objects when contract stability matters.
- If payload evolution matters, favor additive fields and backward-compatible defaults over silent semantic changes.
- If multiple serialization contexts exist, decide which behavior is global and which is boundary-specific.
Output Contract
Return these sections:
Observed behavior: what the current mapper does.Contract expectation: what the wire format should mean.Root cause: module, DTO, annotation, or mapper configuration issue.Minimal fix: the smallest safe code or config change.Compatibility risk: what existing clients or consumers might notice.Verification: tests or sample payloads that prove the behavior.
Guardrails
- Do not recommend random Jackson versions outside the repository's version authority.
- Do not add global mapper behavior for a local one-off issue without explaining blast radius.
- Do not hide a contract problem behind broad
JsonNodeorMap<String, Any>usage unless the boundary is intentionally untyped. - Do not rely on Jackson defaults when a stable external contract matters.
Quality Bar
A good run of this skill explains the wire contract, the mapper mechanics, and the compatibility impact in one coherent answer. A bad run sprinkles annotations until the example payload passes while leaving the contract ambiguous or unstable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

