-
Notifications
You must be signed in to change notification settings - Fork 7
Java data-handling reference could mention Jackson computed getter pitfall #71
Description
Context
When building a Java Temporal application, I created a POJO with a computed getter (getTotalPrice() derived from
quantity * pricePerUnit) used as a workflow parameter. Jackson serialized the computed property into the payload, but
deserialization failed with UnrecognizedPropertyException because there was no corresponding field or setter.
This caused a WorkflowTask processing failure that stuck the workflow until the POJO was fixed with @JsonIgnore.
Suggestion
Add a brief note to references/java/data-handling.md (e.g., in the Best Practices section or near the Jackson
Integration section) mentioning that:
- POJOs used as workflow/activity parameters are serialized via Jackson's default ObjectMapper
- Computed getters (getters without a corresponding field/setter) will be serialized but fail on deserialization
- Use @JsonIgnore on computed getters, or ensure all getters have matching setters
This is standard Jackson behavior, but it's easy to trip over in the Temporal context since the serialization error
surfaces as an opaque WorkflowTask processing failure rather than a compile-time or obvious runtime error.