Serializing a Mail object to/from JSON does not result in equivalent objects. #189
Labels
difficulty: hard
fix is hard in difficulty
status: help wanted
requesting help from the community
type: community enhancement
feature request not on Twilio's roadmap
Issue Summary
Serializing a
Mail
object to/from JSON does not result in equivalent objects.Steps to Reproduce
sameBeanAs
is in the shazamcrest library and performs a recursive deep equality check.The first issue is that the
from
attribute is not deserialized correctly:com.sendgrid.Mail@401e7803[from=<null>,subject=subject,personalization=[com.sendgrid.Personalization@43a0cee9],content=[com.sendgrid.Content@eb21112],attachments=<null>,templateId=<null>,sections=<null>,headers=<null>,categories=<null>,customArgs=<null>,sendAt=0,batchId=<null>,asm=<null>,ipPoolId=<null>,mailSettings=<null>,trackingSettings=<null>,replyTo=<null>]
This seems to be because the
Mail
object has public attributes and non-standard getters:The goal is to write a
Mail
object to a queue so that we can have a process that manages a circuit breaker, rate limiting, retries and DLQ behavior. Right now, I can write the JSON to the queue, but it doesn't deserialize properly when being read.Technical details:
The text was updated successfully, but these errors were encountered: